All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
To: Chris Mason <clm@fb.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: limit the number of asynchronous delalloc pages to reasonable value
Date: Tue, 22 Nov 2016 17:30:45 +0800	[thread overview]
Message-ID: <58341045.3020609@cn.fujitsu.com> (raw)
In-Reply-To: <bf1d53a3-34f5-6b08-2393-71f1c0d5056f@fb.com>

hello,

On 11/22/2016 01:59 AM, Chris Mason wrote:
> On 11/08/2016 04:30 AM, Wang Xiaoguang wrote:
>> The current limit of number of asynchronous delalloc pages is (10 * 
>> SZ_1M).
>> For 4K page, the total ram bytes would be 40G, very big value, I 
>> think in
>> most cases, this limit will not work, here I set limit of the number of
>> asynchronous delalloc pages to SZ_1M(4GB ram bytes).
>>
>> Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
>> ---
>>  fs/btrfs/inode.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
>> index 8e3a5a2..3a910f6 100644
>> --- a/fs/btrfs/inode.c
>> +++ b/fs/btrfs/inode.c
>> @@ -1158,7 +1158,7 @@ static int cow_file_range_async(struct inode 
>> *inode, struct page *locked_page,
>>      struct btrfs_root *root = BTRFS_I(inode)->root;
>>      unsigned long nr_pages;
>>      u64 cur_end;
>> -    int limit = 10 * SZ_1M;
>> +    int limit = SZ_1M;
>>
>>      clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, 
>> EXTENT_LOCKED,
>>               1, 0, NULL, GFP_NOFS);
>>
>
> As Dave points out, I didn't use the right units for this, so even 
> though we definitely waited on this limit while it was in development, 
> that was probably a different bug.
>
> Do you have a test case where the regular writeback throttling isn't 
> enough to also throttle the async delalloc pages?  It might be better 
> to just delete the limit entirely.
Sorry, I don't have one. The real limit is 10 * SZ_1M * 4096, 40GB 
memory, too big value,
and I don't see this limit actually takes effect in my test environment. 
I'm OK with removing
this limit :)

Regards,
Xiaoguang Wang
>
> -chris
>
>




      reply	other threads:[~2016-11-22  9:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08  9:30 [PATCH] btrfs: limit the number of asynchronous delalloc pages to reasonable value Wang Xiaoguang
2016-11-21 16:39 ` David Sterba
2016-11-22  9:20   ` Wang Xiaoguang
2016-11-22 12:40     ` David Sterba
2016-11-22 14:32     ` Chris Mason
2016-11-21 17:59 ` Chris Mason
2016-11-22  9:30   ` Wang Xiaoguang [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=58341045.3020609@cn.fujitsu.com \
    --to=wangxg.fnst@cn.fujitsu.com \
    --cc=clm@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.