Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp722269imu; Tue, 27 Nov 2018 21:05:34 -0800 (PST) X-Google-Smtp-Source: AJdET5d19MMfxTI97l3rFjw334uN/1yV+o2SC0IPsXU+7qI72afUrc9/LLHovJ065WN5o1VrHrIA X-Received: by 2002:a62:b2c3:: with SMTP id z64mr35676502pfl.120.1543381534758; Tue, 27 Nov 2018 21:05:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543381534; cv=none; d=google.com; s=arc-20160816; b=ykPESBzGwwouWO/HsJAfC3LCrMT/v3JzuRlO2/7upzjOLK7sUQZq7Lz2vvgV9rlNa6 Lyrw/xXhp40V/OoBKbZVr/wrEPNSKHYFSXp60EbKh4d1JsxVAFkXDV5+npCFPFSEG6Ng ypsx+bXpvpwhJTM2W24AA0qq0UHkRHPws7OcdkosxPFUemOp1VVGIOI+AaW9zh1kB5dV iH65PO20voPeDrg9PbHqmWd7o+zGMGLzvFFxH1ViW8If/Jw020e2mg3W6dV1y429fM/+ dfhL9PxYOcf0GdcVPRU3wYO2uVWwrVY3nRxeBC16f0mgzJw4Ne7Gg7dmMq3qjsHPpT80 CDpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Iqly93TMrN/jaDnXsuv3naCm5SVPG0loRwoirOcs3SA=; b=W2/GrJf/+rzLIOXK5SJboptIU7YMWReh7aKpwcTrHkZeSZvLiz/jYkuz72BLNg7W1X HcxtSwehe82Yf/UBMalECarpofcxmPig2QdNy5LrIkXSbC7PVUQyI9BR9MQk8qFWtRTj f98ozXYBkgqOTsbHO7+x22RsbrV5wK+91vzBWw0Ckea7uncAk4vD40fDV3mncothHsOU p5xSJFNDlx6g9+rL5Es6zV5yDWFp+OvyjIFZR34/BBiJvmxgadTYKxe/FcKOGsEi2FCW 0QdUjixehxB7t1wWdWWhodw0xFLzatH4MAhtncsK3QRmsWS/DFb5dY92jFPUQpzdzDhO SfaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12si6237248pls.71.2018.11.27.21.05.18; Tue, 27 Nov 2018 21:05:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbeK1QDq (ORCPT + 99 others); Wed, 28 Nov 2018 11:03:46 -0500 Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:41355 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbeK1QDq (ORCPT ); Wed, 28 Nov 2018 11:03:46 -0500 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail07.adl2.internode.on.net with ESMTP; 28 Nov 2018 15:33:24 +1030 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1gRs0R-00047K-NM; Wed, 28 Nov 2018 16:03:23 +1100 Date: Wed, 28 Nov 2018 16:03:23 +1100 From: Dave Chinner To: Allison Henderson 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 Message-ID: <20181128050323.GI6311@dastard> References: <1543376991-5764-1-git-send-email-allison.henderson@oracle.com> <1543376991-5764-5-git-send-email-allison.henderson@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543376991-5764-5-git-send-email-allison.henderson@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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