All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Song Liu <songliubraving@fb.com>
Cc: linux-raid@vger.kernel.org, stockhausen@collogia.de, neilb@suse.de
Subject: Re: [PATCH] right meaning of PARITY_ENABLE_RMW and PARITY_PREFER_RMW
Date: Wed, 25 May 2016 09:02:16 -0700	[thread overview]
Message-ID: <20160525160216.GA15101@kernel.org> (raw)
In-Reply-To: <1464049506-1589075-1-git-send-email-songliubraving@fb.com>

On Mon, May 23, 2016 at 05:25:06PM -0700, Song Liu wrote:
> In current handle_stripe_dirtying, the code prefers rmw with
> PARITY_ENABLE_RMW; while prefers rcw with PARITY_PREFER_RMW.
> 
> This patch reverses this behavior.
> 
> Signed-off-by: Song Liu <songliubraving@fb.com>
> Signed-off-by: Shaohua Li <shli@fb.com>
> ---
>  drivers/md/raid5.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 8959e6d..ad9e15a 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -3600,7 +3600,7 @@ static void handle_stripe_dirtying(struct r5conf *conf,
>  	pr_debug("for sector %llu, rmw=%d rcw=%d\n",
>  		(unsigned long long)sh->sector, rmw, rcw);
>  	set_bit(STRIPE_HANDLE, &sh->state);
> -	if ((rmw < rcw || (rmw == rcw && conf->rmw_level == PARITY_ENABLE_RMW)) && rmw > 0) {
> +	if ((rmw < rcw || (rmw == rcw && conf->rmw_level == PARITY_PREFER_RMW)) && rmw > 0) {
>  		/* prefer read-modify-write, but need to get some data */
>  		if (conf->mddev->queue)
>  			blk_add_trace_msg(conf->mddev->queue,
> @@ -3627,7 +3627,7 @@ static void handle_stripe_dirtying(struct r5conf *conf,
>  			}
>  		}
>  	}
> -	if ((rcw < rmw || (rcw == rmw && conf->rmw_level != PARITY_ENABLE_RMW)) && rcw > 0) {
> +	if ((rcw < rmw || (rcw == rmw && conf->rmw_level != PARITY_PREFER_RMW)) && rcw > 0) {
>  		/* want reconstruct write, but need to get some data */
>  		int qread =0;
>  		rcw = 0;

The patch looks correct, I'll apply.

I'm wondering why original code is in current way. It dosn't work like what the
patch log (d06f191f8ecae) describes. Neil/Markus, is any patch missed?

Thanks,
Shaohua

  reply	other threads:[~2016-05-25 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24  0:25 [PATCH] right meaning of PARITY_ENABLE_RMW and PARITY_PREFER_RMW Song Liu
2016-05-25 16:02 ` Shaohua Li [this message]
2016-05-25 17:07   ` AW: " Markus Stockhausen

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=20160525160216.GA15101@kernel.org \
    --to=shli@kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=songliubraving@fb.com \
    --cc=stockhausen@collogia.de \
    /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.