[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00ade77c-5451-4953-0232-89342a029f33@huawei.com>
Date: Tue, 5 Nov 2019 10:49:43 +0800
From: Chao Yu <yuchao0@...wei.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-f2fs-devel@...ts.sourceforge.net>
Subject: Re: [PATCH 3/3] Revert "f2fs: use kvmalloc, if kmalloc is failed"
On 2019/11/5 10:38, Eric Biggers wrote:
> On Tue, Nov 05, 2019 at 10:17:41AM +0800, Chao Yu wrote:
>> On 2019/11/5 8:02, Jaegeuk Kim wrote:
>>> On 11/01, Chao Yu wrote:
>>>> This reverts commit 5222595d093ebe80329d38d255d14316257afb3e.
>>>>
>>>> As discussed with Eric, as kvmalloc() will try kmalloc() first, so
>>>> when we need allocate large size memory, it'd better to use
>>>> f2fs_kvmalloc() directly rather than adding additional fallback
>>>> logic to call kvmalloc() after we failed in f2fs_kmalloc().
>>>>
>>>> In order to avoid allocation failure described in original commit,
>>>> I change to use f2fs_kvmalloc() for .free_nid_bitmap bitmap memory.
>>>
>>> Is there any problem in the previous flow?
>>
>> No existing problem, however, it's redundant to introduce fallback flow in
>> f2fs_kmalloc() like vmalloc() did, since we can call f2fs_vmalloc() directly in
>> places where we need large memory.
>>
>> Thanks,
>>
>
> f2fs_kmalloc() also violated the naming convention used everywhere else in the
> kernel since it could return both kmalloc and vmalloc memory, not just kmalloc
> memory. That's really error-prone since people would naturally assume it's safe
> to free the *_kmalloc()-ed memory with kfree().
Agreed.
Thanks,
>
> - Eric
> .
>
Powered by blists - more mailing lists