All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: Chris Mason <chris.mason@fusionio.com>,
	Chris Mason <clmason@fusionio.com>,
	Linux Btrfs List <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: improve the delayed inode throttling
Date: Thu, 07 Mar 2013 13:53:22 +0800	[thread overview]
Message-ID: <51382B52.9060708@cn.fujitsu.com> (raw)
In-Reply-To: <20130307030650.GB13323@shiny.masoncoding.com>

On 	wed, 6 Mar 2013 22:06:50 -0500, Chris Mason wrote:
> On Wed, Mar 06, 2013 at 06:39:30PM -0700, Miao Xie wrote:
>> On wed, 6 Mar 2013 09:53:28 -0500, Chris Mason wrote:
>> [SNIP]
>>> +	async_work->delayed_root = delayed_root;
>>> +	async_work->work.func = btrfs_async_run_delayed_root;
>>> +	async_work->work.flags = 0;
>>> +	if (nr)
>>> +		async_work->nr = 0;
>>> +	else
>>> +		async_work->nr = nr;
>>
>> the code here is wrong.
>> the argument nr is the number we want to deal with, if it is 0, we will deal with all.
> 
> Whoops, thanks.  I missed that when I was cleaning things up.
> 
>>>  
>>> -	btrfs_wq_run_delayed_node(delayed_root, root, 0);
>>> +	btrfs_wq_run_delayed_node(delayed_root, root, BTRFS_DELAYED_BATCH);
>>>  }
>>
>> There is a problem that we may introduce lots of btrfs_works, we need avoid
>> it.
> 
> It is possible, but we won't make more than we used to.  The real
> solution is to limit the workers per root, but the code isn't currently
> structured for that.  Right now the workers will exit out if the number
> of pending items is below the delayed limit, which isn't perfect but I
> think it's the best I can do right now.
> 
> Do you see better ways to improve it?

How do you think about per-cpu btrfs_work? If btrfs_work on the current cpu
is dealt with, we don't queue it, just update ->nr if need and tell the workers
that we need do flush again.

(This way is a bit ugly because btrfs_work might not be handled on its cpu)

Thanks
Miao
> --
> 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-03-07  5:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 15:40 [PATCH] Btrfs: improve the delayed inode throttling Chris Mason
2013-03-06  0:37 ` Liu Bo
2013-03-06  1:51   ` Chris Mason
2013-03-06  2:45 ` Miao Xie
2013-03-06 14:53   ` Chris Mason
2013-03-07  1:19     ` Miao Xie
2013-03-07  1:39     ` Miao Xie
2013-03-07  3:06       ` Chris Mason
2013-03-07  5:53         ` Miao Xie [this message]
2013-03-07 15:42           ` Chris Mason

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=51382B52.9060708@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=chris.mason@fusionio.com \
    --cc=clmason@fusionio.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.