Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1932429imu; Tue, 6 Nov 2018 06:36:43 -0800 (PST) X-Google-Smtp-Source: AJdET5d2HsRPJDCjEAhNG4+0/osNqAm4C15kWJ4asfVMZ+us8hmg3B7gF62MHONYxTsIat/FJOyw X-Received: by 2002:a62:995c:: with SMTP id d89-v6mr26191143pfe.11.1541515003315; Tue, 06 Nov 2018 06:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541515003; cv=none; d=google.com; s=arc-20160816; b=GPwzgc8Wbadfex1B5XLF8G1fqwa9A05g3MssIqzWIJJwLu38Fo6TgtptY9xuJul78W Do12903mifj91k8nDsz4qJhVVy0lkvpxst4+6LDKrfoMk48FNN3GV1udyqOivjwkTxKb mLAzbImeC6DRUTSBnGLdjX/fSQh0u1xCzuqakZA0vaKSzangsf3hvO59MmC7EFn2NO3B 9bjQZOaL0W69ZFFKWOk5/auci0l00+nq5sgKlVuM4EV+WDErO2t0v/qH/VdD2X/qRNao RnLgVRPTnU0fV1+mHc7qRrC0dSmxxMSQpIJQQEt+q7clG9JHD7skHgC+9PEmVlCPecWI reng== 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=rnIpz9zEEOdTCK3tYNDCIilm2xocHoP7+ouJyHbTfoc=; b=Wu6aKYJxw84G8zWeTAFFif2GK5chpicAr7xZeroeZEzZQMG1eNLvXVtT0XnUFCFVXo CFpWQrYc5DE9Lv/uO5eiItt/nm93WGfU/+v52WGkOb52kQe+uMySm6wF4K7vgiED58DO r9rIuKzN1M1r03z17LuHjkGUgsepHMvxDMQ/2tAdWif0tH4SnlCIZZMvP7gbwHWQFpNJ 0H5wOn3EJc2vLou28uOZus4SQOawzsCrHiQr3TuST7ijq2Q9EwH3U5Eql78m8dna8Cw7 dWlBwcJyHixw2yTDoXLed9UCq7kW04z8M2UbREKm01kfsXiIBG4thn3n1tfJMK6QwxXL KEvA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si10181679pgi.147.2018.11.06.06.36.19; Tue, 06 Nov 2018 06:36:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388832AbeKFX7V (ORCPT + 99 others); Tue, 6 Nov 2018 18:59:21 -0500 Received: from mga17.intel.com ([192.55.52.151]:19365 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388284AbeKFX7V (ORCPT ); Tue, 6 Nov 2018 18:59:21 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2018 06:33:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,472,1534834800"; d="scan'208";a="103861303" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga004.fm.intel.com with ESMTP; 06 Nov 2018 06:33:50 -0800 Date: Tue, 6 Nov 2018 07:31:43 -0700 From: Keith Busch To: Johannes Thumshirn Cc: Jens Axboe , Linux Block Layer Mailinglist , Hannes Reinecke , Linux Kernel Mailinglist , Jan Kara , Sagi Grimberg Subject: Re: [PATCH] block: respect virtual boundary mask in bvecs Message-ID: <20181106143143.GA5977@localhost.localdomain> References: <20181105102301.9752-1-jthumshirn@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181105102301.9752-1-jthumshirn@suse.de> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 05, 2018 at 11:23:01AM +0100, Johannes Thumshirn wrote: > With drivers like iSer we are seeing a lot of bio splitting and smaller I/Os > being submitted to the driver. > > The root cause of this issue that the virtual boundary mask code does not take > into consideration that some of the memory segments in the SG list may have > come from a huge memory page that is being managed in the SG list as 4K > blocks. This means that many of the segments in the SG list will have an > offset into the page that is not 0 but will be a multiple of 4K. I probably got this wrong, but I thought a 2M huge page was 512 regular pages with a compound head, and offsets were from those regular pages rather than from the head. Overall though, the patch makes sense to me for this and other reasons. Acked-by: Keith Busch > Cc: Jan Kara > Cc: Sagi Grimberg > Signed-off-by: Johannes Thumshirn > --- > block/blk-merge.c | 2 +- > block/blk.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/blk-merge.c b/block/blk-merge.c > index 6b5ad275ed56..208658a901c6 100644 > --- a/block/blk-merge.c > +++ b/block/blk-merge.c > @@ -46,7 +46,7 @@ static inline bool bio_will_gap(struct request_queue *q, > bio_get_first_bvec(prev_rq->bio, &pb); > else > bio_get_first_bvec(prev, &pb); > - if (pb.bv_offset) > + if (pb.bv_offset & queue_virt_boundary(q)) > return true; > > /* > diff --git a/block/blk.h b/block/blk.h > index a1841b8ff129..c85e53f21cdd 100644 > --- a/block/blk.h > +++ b/block/blk.h > @@ -169,7 +169,7 @@ static inline bool biovec_phys_mergeable(struct request_queue *q, > static inline bool __bvec_gap_to_prev(struct request_queue *q, > struct bio_vec *bprv, unsigned int offset) > { > - return offset || > + return (offset & queue_virt_boundary(q)) || > ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); > } > > --