From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry
Date: Mon, 24 Aug 2015 14:10:22 +0800 [thread overview]
Message-ID: <55DAB54E.5000007@huawei.com> (raw)
In-Reply-To: <20150824045625.GB2837@jaegeuk-mac02.mot-mobility.com>
On 2015/8/24 12:56, Jaegeuk Kim wrote:
> Hi Zhang,
>
> On Mon, Aug 24, 2015 at 11:39:55AM +0800, Zhang Zhen wrote:
>> __add_ino_entry is looping around the allocation request and minics
>> __GFP_NOFAIL behavior without any allocation fallback strategy.
>> Here remove the open coded loop and replace it with __GFP_NOFAIL.
>>
>> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
>> ---
>> fs/f2fs/checkpoint.c | 7 +------
>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>> index b70bbe1..d62363b 100644
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -337,12 +337,7 @@ retry:
>>
>> e = radix_tree_lookup(&im->ino_root, ino);
>> if (!e) {
>> - e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
>> - if (!e) {
>> - spin_unlock(&im->ino_lock);
>> - radix_tree_preload_end();
>> - goto retry;
>> - }
>> + e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC|__GFP_NOFAIL);
>
> I submitted a patch to replace GFP_ATOMIC with GFP_NOFS.
> We can avoid to use GFP_ATOMIC here, right?
>
Yes, i think so.
> Thanks,
>
>> if (radix_tree_insert(&im->ino_root, ino, e)) {
>> spin_unlock(&im->ino_lock);
>> kmem_cache_free(ino_entry_slab, e);
>> --
>> 1.9.1
>>
>>
>> .
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>
>
------------------------------------------------------------------------------
prev parent reply other threads:[~2015-08-24 6:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1440386638-40325-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-08-24 3:39 ` [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry Zhang Zhen
2015-08-24 4:56 ` Jaegeuk Kim
2015-08-24 6:10 ` Zhang Zhen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55DAB54E.5000007@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).