Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
To: Jan Schmidt <list.btrfs@jan-o-sch.net>
Cc: Wang Shilong <wangshilong1991@gmail.com>,
	"linux-btrfs@vger.kernel.org Btrfs" <linux-btrfs@vger.kernel.org>,
	Wang Shilong <wangsl-fnst@fujitsu.com>
Subject: Re: [PATCH] Btrfs: use arg gfp_mask to decide how to allocate tree mod
Date: Mon, 06 May 2013 14:20:58 +0800	[thread overview]
Message-ID: <51874BCA.5070104@cn.fujitsu.com> (raw)
In-Reply-To: <518748E1.4030209@jan-o-sch.net>

Hello Jan,

> On Sun, May 05, 2013 at 15:58 (+0200), Wang Shilong wrote:
>> It seems the original code doesn't pass the right arg gfp_t to decide how to allocate.
>> Just applying this patch, fsstress will fail. So please ignore this patch, will resend later..
> 
> That's in fact what the comment above the line you changed implies :-)


e.. It seems tree_mod_alloc() will always allocate with GFP_ATOMIC in your code.
However, i think we should try best not to allocate with GTP_ATOMIC.. otherwise,
at least.. the arg gfp_t you try to pass is useless and should be removed ^_^


Thanks,
Wang

> 
> -Jan
> 
>> Thanks,
>> Wang
>>
>>> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>>>
>>> We have passed arg gfp_mask to tree_mod_alloc(), so
>>> just use it rather than always use GFP_ATOMIC.
>>>
>>> Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>>> ---
>>> fs/btrfs/ctree.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
>>> index de6de8e..0e3514f 100644
>>> --- a/fs/btrfs/ctree.c
>>> +++ b/fs/btrfs/ctree.c
>>> @@ -553,7 +553,7 @@ static inline int tree_mod_alloc(struct btrfs_fs_info *fs_info, gfp_t flags,
>>> 	 * once we switch from spin locks to something different, we should
>>> 	 * honor the flags parameter here.
>>> 	 */
>>> -	tm = *tm_ret = kzalloc(sizeof(*tm), GFP_ATOMIC);
>>> +	tm = *tm_ret = kzalloc(sizeof(*tm), flags);
>>> 	if (!tm)
>>> 		return -ENOMEM;
>>>
>>> -- 
>>> 1.7.11.7
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 




  reply	other threads:[~2013-05-06  6:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1367730320-7660-1-git-send-email-wangshilong1991@gmail.com>
2013-05-05 13:58 ` [PATCH] Btrfs: use arg gfp_mask to decide how to allocate tree mod Wang Shilong
2013-05-06  6:08   ` Jan Schmidt
2013-05-06  6:20     ` Wang Shilong [this message]
2013-05-06  6:33       ` Wang Shilong

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=51874BCA.5070104@cn.fujitsu.com \
    --to=wangsl-fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=list.btrfs@jan-o-sch.net \
    --cc=wangshilong1991@gmail.com \
    --cc=wangsl-fnst@fujitsu.com \
    /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