Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp514645imu; Mon, 26 Nov 2018 14:13:52 -0800 (PST) X-Google-Smtp-Source: AJdET5fOm5OnPx7j8i0FqkonK1VT8cY1apfVPEnZ4KoXdc4KWosSpxRdMf1laSQyKUj/owyE8yMz X-Received: by 2002:a63:101d:: with SMTP id f29mr26948214pgl.38.1543270432242; Mon, 26 Nov 2018 14:13:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543270432; cv=none; d=google.com; s=arc-20160816; b=amBWW/si5NEeliTT8tNFom0ZanvFfZ6+Tq05KWFwIpc7kufDh8xO69wk/14+SfmuVX F4Gd8wQjh5YSLe/7zbhSOxE78fu5BfnlGxZp0outoPrhpTmSeMvzGqtMqnmwpZbD/tGo SxgclHD/btVIga/n91IhRzk7IKaDYf8pqAWlUNHP1dyJgJg7MlAfHWvIMsYFAOv/Bs7E 8Y2pLOxjHRDg+LPKy2F5lGrdma4mdKP8eC1VFXHu5Xe0twaB2DfHbO4HlVam5DwQ9gnA BkJNdIZv5OiP1WkBhIAShthE8mADRClj/CzDuzYuJ5LLWv6GxM62FEjDodSNIxsF38HE kiDA== 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:dkim-signature; bh=Z828Q1hGWN4xE0ZgmUT37ch1Jh+fPsJT+V+amprtHxs=; b=XhfkTigOpBydjm5pFPRc6iyLdVSk1X7S0b1l8Ie3y18HRtHnno6inb4nu+4OdWNBx+ 6+jiqb0psJTamJADuM7OQTKHPpLaeIiHLxTLOAT3woKY1R4DPI5yJloBADVpgSNkFYC2 +Cedo4ym3X63S1raF3bLMO6ZIOav4bmofoEQD9sv736UCCx3HV8MWonP+R+wrS8h9+ve U9ck7aa3lxVIKTtPMyTiSF8aniMOrqQ2Gs8FuuXUbLbq4qQWYItZgNI66OZZEI5np8M8 lr3VLD9x1x3kjf4rLWAB8jn/FJpRi23X8r6mt6ChEo7EKBP+D81QMG2iDFq0JranNH1p lFJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b="f/7XFRkx"; 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 g1-v6si1522943plt.215.2018.11.26.14.13.35; Mon, 26 Nov 2018 14:13:52 -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; dkim=pass header.i=@osandov-com.20150623.gappssmtp.com header.s=20150623 header.b="f/7XFRkx"; 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 S1727087AbeK0JIe (ORCPT + 99 others); Tue, 27 Nov 2018 04:08:34 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36137 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726296AbeK0JIe (ORCPT ); Tue, 27 Nov 2018 04:08:34 -0500 Received: by mail-pg1-f193.google.com with SMTP id n2so6826806pgm.3 for ; Mon, 26 Nov 2018 14:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Z828Q1hGWN4xE0ZgmUT37ch1Jh+fPsJT+V+amprtHxs=; b=f/7XFRkxWkgNbPNPf+s6683DpOao683kKiPGfp+GDY1wWulUsqMdaALo9ICdTUmCxJ N9V3AYcRNie0T3XNvPm5DKhfUhniEaEw3zGp9Hse6oePD1pVUsqmvE2uC/mcg5+XIxnU LMKdFvP/+gdqw+WJ+0zz33dXh471ApwV+CszQ6S8iVabJDAyB8RgAw6VXGF1THvbn6Kj o9Flhc42RZGBCVbTQs5wtxHFWH2GcnA1vBPkvQefc+fi2XIgy8Vx9Q8wXXGWNEv5FBGD r3wuGSM48Ustfn1hUNS3X++TFN30nIeaTExPEOtWt+kYFe39c/YU7xDg2ixcbDV4lgxx K8zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Z828Q1hGWN4xE0ZgmUT37ch1Jh+fPsJT+V+amprtHxs=; b=tHUB7+57UTVZV+x7qO85aL7m3Zvwl/XeCvfWzUCnFMmbluqDK3vOjb4Uj54kx/fU9u 8cZ2JzCPSzuGhLqOuDh8mYFtmjNMvWbygzxbi1gLKlAkZE0YFw0qhk2iABzCyAYm8Ft0 gGEm2I/s7hZRot8MDPfYYdqjI0xnK5RUUgcGAvZk8znHSpiU/cp5yqtjsAne0H0IJ98i QF9J1EgyRMZ152DDXLcITdaFV7aeVK8vZhZbwVpUBqJI2GiAD4Ok8QWPREmWFcE9+bUG 0Yd2yWF5If48ge97xeDCloepGud+hczl9RxvNJEjrwcRl37wajoTwzWPC+rSqu8L4p9B BTwg== X-Gm-Message-State: AGRZ1gJyC4Q1wrW5KkFt13DTFYeLqSKyQFSJe52CiBpK0E+apb61PG+O bvfF5oUX8q3L+BBcL7u1cpmtr+5/NTgwaQ== X-Received: by 2002:a62:6d07:: with SMTP id i7-v6mr31099102pfc.146.1543270378421; Mon, 26 Nov 2018 14:12:58 -0800 (PST) Received: from vader ([2601:602:8b00:55d3:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id v184sm1780153pfb.182.2018.11.26.14.12.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 14:12:57 -0800 (PST) Date: Mon, 26 Nov 2018 14:12:56 -0800 From: Omar Sandoval To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , Omar Sandoval , Sagi Grimberg , Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Christoph Hellwig , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com Subject: Re: [PATCH V12 03/20] block: remove the "cluster" flag Message-ID: <20181126221256.GD30411@vader> References: <20181126021720.19471-1-ming.lei@redhat.com> <20181126021720.19471-4-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126021720.19471-4-ming.lei@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 10:17:03AM +0800, Ming Lei wrote: > From: Christoph Hellwig > > The cluster flag implements some very old SCSI behavior. As far as I > can tell the original intent was to enable or disable any kind of > segment merging. But the actually visible effect to the LLDD is that > it limits each segments to be inside a single page, which we can > also affect by setting the maximum segment size and the segment > boundary. Reviewed-by: Omar Sandoval One comment typo below. > Signed-off-by: Christoph Hellwig > > Replace virt boundary with segment boundary limit. > > Signed-off-by: Ming Lei > --- > block/blk-merge.c | 20 ++++++++------------ > block/blk-settings.c | 3 --- > block/blk-sysfs.c | 5 +---- > drivers/scsi/scsi_lib.c | 20 ++++++++++++++++---- > include/linux/blkdev.h | 6 ------ > 5 files changed, 25 insertions(+), 29 deletions(-) > [snip] > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index 0df15cb738d2..78d6d05992b0 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -1810,6 +1810,8 @@ static int scsi_map_queues(struct blk_mq_tag_set *set) > void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) > { > struct device *dev = shost->dma_dev; > + unsigned max_segment_size = dma_get_max_seg_size(dev); > + unsigned long segment_boundary = shost->dma_boundary; > > /* > * this limit is imposed by hardware restrictions > @@ -1828,13 +1830,23 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) > blk_queue_max_hw_sectors(q, shost->max_sectors); > if (shost->unchecked_isa_dma) > blk_queue_bounce_limit(q, BLK_BOUNCE_ISA); > - blk_queue_segment_boundary(q, shost->dma_boundary); > dma_set_seg_boundary(dev, shost->dma_boundary); > > - blk_queue_max_segment_size(q, dma_get_max_seg_size(dev)); > + /* > + * Clustering is a really old concept from the stone age of Linux > + * SCSI support. But the basic idea is that we never give the > + * driver a segment that spans multiple pages. For that we need > + * to limit the segment size, and set the segment boundary so that > + * we never merge a second segment which is no page aligned. Typo, "which is not page aligned".