From: NeilBrown <neilb@suse.de>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH 3/3] raid1: Rewrite the implementation of iobarrier.
Date: Mon, 26 Aug 2013 17:49:56 +1000 [thread overview]
Message-ID: <20130826174956.7beea63a@notabene.brown> (raw)
In-Reply-To: <201308191958041664556@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
On Mon, 19 Aug 2013 19:58:07 +0800 majianpeng <majianpeng@gmail.com> wrote:
> @@ -846,10 +859,57 @@ static void lower_barrier(struct r1conf *conf)
> wake_up(&conf->wait_barrier);
> }
>
> -static void wait_barrier(struct r1conf *conf)
> +static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
> {
> + sector_t sector = 0;
> spin_lock_irq(&conf->resync_lock);
> - if (conf->barrier) {
> + if (conf->barrier || unlikely(conf->freeze_array)) {
> + if (unlikely(!conf->freeze_array && bio) &&
I forgot to mention this bit.
If we need to test freeze_array here, then maybe that test should have been
added in the previous patch which introduced "freeze_array"?
And I think the field should be "array_frozen". "freeze_array" sounds like
an action so it is a suitable name for a function, but not for a variable.
Also I think you probably mean "likely" rather than "unlikely" the second
time???
I rather avoid "likely" and "unlikely" calls unless they will really
make an important difference.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2013-08-26 7:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-19 11:58 [PATCH 3/3] raid1: Rewrite the implementation of iobarrier majianpeng
2013-08-26 7:46 ` NeilBrown
2013-08-26 10:45 ` majianpeng
2013-08-26 7:49 ` NeilBrown [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=20130826174956.7beea63a@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=majianpeng@gmail.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).