From: Shaohua Li <shli@kernel.org>
To: Coly Li <colyli@suse.de>
Cc: linux-raid@vger.kernel.org, Shaohua Li <shli@fb.com>,
Neil Brown <neilb@suse.de>
Subject: Re: [PATCH v2] RAID1: Avoid unnecessary loop to decrease conf->nr_queued in raid1d()
Date: Wed, 16 Nov 2016 12:05:19 -0800 [thread overview]
Message-ID: <20161116200519.v6y6t4dsbl2zshk2@kernel.org> (raw)
In-Reply-To: <785b7474-2e3a-e423-08d7-26cb6136a235@suse.de>
On Wed, Nov 16, 2016 at 10:36:32PM +0800, Coly Li wrote:
> 在 2016/11/16 下午10:19, Coly Li 写道:
> [snip]
> > ---
> > drivers/md/raid1.c | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > Index: linux-raid1/drivers/md/raid1.c
> > ===================================================================
> > --- linux-raid1.orig/drivers/md/raid1.c
> > +++ linux-raid1/drivers/md/raid1.c
> > @@ -2387,17 +2387,17 @@ static void raid1d(struct md_thread *thr
> [snip]
> > while (!list_empty(&tmp)) {
> > r1_bio = list_first_entry(&tmp, struct r1bio,
> > retry_list);
> > list_del(&r1_bio->retry_list);
> > + spin_lock_irqsave(&conf->device_lock, flags);
> > + conf->nr_queued--;
> > + spin_unlock_irqrestore(&conf->device_lock, flags);
> [snip]
>
> Now I work on another 2 patches for a simpler I/O barrier, and a
> lockless I/O submit on raid1, where conf->nr_queued will be in atomic_t.
> So spin lock expense will not exist any more. Just FYI.
I'd like to hold this patch till you post the simpler I/O barrier, as the patch
itself currently doesn't make the process faster (lock/unlock is much heavier
than the loop).
Thanks,
Shaohua
next prev parent reply other threads:[~2016-11-16 20:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 14:19 [PATCH v2] RAID1: Avoid unnecessary loop to decrease conf->nr_queued in raid1d() Coly Li
2016-11-16 14:36 ` Coly Li
2016-11-16 20:05 ` Shaohua Li [this message]
2016-11-21 10:16 ` Coly Li
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=20161116200519.v6y6t4dsbl2zshk2@kernel.org \
--to=shli@kernel.org \
--cc=colyli@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
--cc=shli@fb.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).