All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Allison Henderson <allison.henderson@oracle.com>
Cc: linux-block@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	martin.petersen@oracle.com, shirley.ma@oracle.com,
	bob.liu@oracle.com
Subject: Re: [PATCH v1 4/7] xfs: Add b_rw_hint to xfs_buf
Date: Wed, 28 Nov 2018 16:03:23 +1100	[thread overview]
Message-ID: <20181128050323.GI6311@dastard> (raw)
In-Reply-To: <1543376991-5764-5-git-send-email-allison.henderson@oracle.com>

On Tue, Nov 27, 2018 at 08:49:48PM -0700, Allison Henderson wrote:
> This patch adds a new field b_rw_hint to xfs_buf.  We will
> need this to properly initialize the new bio->bi_rw_hint when
> submitting the read request.  When the read completes, we
> then store the returned mirror in the b_rw_hint.
> 
> Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
> ---
>  fs/xfs/xfs_buf.c | 5 ++++-
>  fs/xfs/xfs_buf.h | 7 +++++++
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index b21ea2b..dd8ba59 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1322,8 +1322,10 @@ xfs_buf_bio_end_io(
>  	if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ))
>  		invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp));
>  
> -	if (atomic_dec_and_test(&bp->b_io_remaining) == 1)
> +	if (atomic_dec_and_test(&bp->b_io_remaining) == 1) {
> +		bp->b_rw_hint = bio->bi_rw_hint;
>  		xfs_buf_ioend_async(bp);
> +	}
>  	bio_put(bio);
>  }
>  

This will miss setting bp->b_rw_hint for IO that completes before
submission returns to __xfs_buf_submit() (i.e. b_io_remaining is 2
at IO completion).

So I suspect it won't do the right thing on fast or synchronous
block devices like pmem. You should be able to tst this with a RAID1
made from two ramdisks...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-11-28  5:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  3:49 [RFC PATCH v1 0/7] Block/XFS: Support alternative mirror device retry Allison Henderson
2018-11-28  3:49 ` [PATCH v1 1/7] block: add nr_mirrors to request_queue Allison Henderson
2018-11-28  3:49 ` [PATCH v1 2/7] block: expand write_hint of bio/request to rw_hint Allison Henderson
2018-11-28  3:49 ` [PATCH v1 3/7] md: raid1: handle bi_rw_hint accordingly Allison Henderson
2018-11-28  3:49 ` [PATCH v1 4/7] xfs: Add b_rw_hint to xfs_buf Allison Henderson
2018-11-28  5:03   ` Dave Chinner [this message]
2018-11-28  3:49 ` [PATCH v1 5/7] xfs: Add device retry Allison Henderson
2018-11-28  5:08   ` Dave Chinner
2018-11-28  5:22     ` Darrick J. Wong
2018-11-28  5:38       ` Dave Chinner
2018-11-28  7:35     ` Christoph Hellwig
2018-11-28 12:41       ` Bob Liu
2018-11-28 16:47         ` Allison Henderson
2018-11-28  3:49 ` [PATCH v1 6/7] xfs: Rewrite retried read Allison Henderson
2018-11-28  5:17   ` Dave Chinner
2018-11-28  5:26     ` Darrick J. Wong
2018-11-28  5:40       ` Dave Chinner
2018-11-28  3:49 ` [PATCH v1 7/7] xfs: Add tracepoints and logging to alternate device retry Allison Henderson
2018-11-28  5:33 ` [RFC PATCH v1 0/7] Block/XFS: Support alternative mirror " Dave Chinner
2018-11-28  5:49   ` Darrick J. Wong
2018-11-28  6:30     ` Dave Chinner
2018-11-28  7:15       ` Darrick J. Wong
2018-11-28 19:38     ` Andreas Dilger
2018-11-28  7:37   ` Christoph Hellwig
2018-11-28  7:46     ` Dave Chinner
2018-11-28  7:51       ` Christoph Hellwig
2018-11-28  7:45   ` Christoph Hellwig
2018-12-08 14:49     ` Bob Liu
2018-12-10  4:30       ` Darrick J. Wong

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=20181128050323.GI6311@dastard \
    --to=david@fromorbit.com \
    --cc=allison.henderson@oracle.com \
    --cc=bob.liu@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=shirley.ma@oracle.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 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.