Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp378997imu; Mon, 5 Nov 2018 02:23:50 -0800 (PST) X-Google-Smtp-Source: AJdET5fFVA7nCKM+kz7jTpN8Zz8AqYPWaHf7SZIDoxTBdmap3synJDeHQ7plE2sIwwc7cOZw/89c X-Received: by 2002:a63:1342:: with SMTP id 2-v6mr19409338pgt.19.1541413430249; Mon, 05 Nov 2018 02:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541413430; cv=none; d=google.com; s=arc-20160816; b=mubKQ8RM/FGimAMCz700lDJz0uC4TZ2NcknXh1tc7OOPa85V8o6BXzwQrWO5h1R3yF Kw5WGjcWSSr11Sih8t5XE2EfcTuX3NJbAp5I6xJAZ9SaeB+RoD69vSmFqaEOh9NVzMra rvQjlDyLLy6mwQpG6hXFGgFt7r3YEgznc2ChwReRSe3+SgmekR6O5YwhUFlTbtBzmmhL sh3oCX9NU7/r0Y6tlgYjl4eL5od4WLcstplxkDa2e/5bUV5JzqiX6LBvz99jJahBfOxz +tl3L0CTHB2/sRPvfJxo2gg1CyX0xowUdWuUWEfC5CStMQ7gC89SzWuz0XNf7bF0OTJU VGWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=q353dPG79k49dpBZcRlLRxkrWv5tGs0BK9oB2k2MHNg=; b=DtBC4jc4t1w4D9UnBebzlc7ehv5hbtbpXjfkQqBgRAw6AHKdXt6dYg7vY16MhPhWWs BfZCBpIYPeNtOA25/rSyDxFsXTTUVqV47yazl9oM5NKwdqigIIDiB28ZHQQyKDzgII+M hrtKCtKpPLlYfhLJWstRwhdQHGbGqeSksnNljuV+/EPpah3HNIFgTZd3Zvm/qjsOvhPm F7xYkVjwQV6ne90n7UJVENi5KsK//hH+4IsQRNw7Ao2Unfh09nYPIkzRF4ZoE8+/vcor jTEFOcVyiQ9s3MSM9kIMoZYB9tzv+XUaXpkkEfcnBN6Wn3ol9ADYpRsCp5LNGpM0sU4C x/jw== 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 c10si6310332pgt.222.2018.11.05.02.23.33; Mon, 05 Nov 2018 02:23:50 -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 S1727259AbeKETmL (ORCPT + 99 others); Mon, 5 Nov 2018 14:42:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:37456 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726125AbeKETmL (ORCPT ); Mon, 5 Nov 2018 14:42:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C1BB3AF4D; Mon, 5 Nov 2018 10:23:10 +0000 (UTC) From: Johannes Thumshirn To: Jens Axboe Cc: Linux Block Layer Mailinglist , Hannes Reinecke , Linux Kernel Mailinglist , Johannes Thumshirn , Jan Kara , Sagi Grimberg Subject: [PATCH] block: respect virtual boundary mask in bvecs Date: Mon, 5 Nov 2018 11:23:01 +0100 Message-Id: <20181105102301.9752-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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)); } -- 2.16.4