From: Chris Mason <chris.mason@fusionio.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: Chris Mason <clmason@fusionio.com>,
Linux Btrfs List <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: improve the delayed inode throttling
Date: Thu, 7 Mar 2013 10:42:08 -0500 [thread overview]
Message-ID: <20130307154208.GB5784@shiny.masoncoding.com> (raw)
In-Reply-To: <51382B52.9060708@cn.fujitsu.com>
On Wed, Mar 06, 2013 at 10:53:22PM -0700, Miao Xie wrote:
> 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)
Yeah, I'd prefer that we add a per-root counter of some kind.
-chris
prev parent reply other threads:[~2013-03-07 15:42 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
2013-03-07 15:42 ` Chris Mason [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=20130307154208.GB5784@shiny.masoncoding.com \
--to=chris.mason@fusionio.com \
--cc=clmason@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.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;
as well as URLs for NNTP newsgroup(s).