Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp814056pxj; Wed, 2 Jun 2021 12:07:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzahtpT1eqm5Zj9SNY25EyNEMSmn3phWCBJ/9dsCMqVFAGmq27aBd2k8SqQz8INxjoo90VQ X-Received: by 2002:aa7:d28a:: with SMTP id w10mr11056022edq.23.1622660837020; Wed, 02 Jun 2021 12:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622660837; cv=none; d=google.com; s=arc-20160816; b=DRuJPBp125nTbDIKduzj37t78uMtquSsESDLsYayHqZAC85NQbQaO8lrwJjIj6G6Gi tWTpZFun13CX5zR75TsSQ+On1RePnaUfsFX7HD8xIqmtA33C0qSucZ9fS/ifsPO4UNCX 0lSIjEKJrIfdRRRbg3wofk3rF9mWUZP5v01FMzFUbbIzjrlkwwRrT5b4cs+XTQ8+H+Db Qbt5QlRIoQvZ+NdvhV3vSBL6RTrr6DR8qtyyAt/lEO7cpbrqBelexxN1XJ/hSQXFwrKQ HAifWgpkpQgSA9mJhcipULteYVJT7vXsUQ8FyktTS4K/fpM0ehjICzQkOz/KNvumTTVI pqZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2jsgl46qTXUFETegG4YX4Eozd/vKYgq51F4jK7XaaDw=; b=hKQhv4f/IFvcVZQmQS71JZFjAx12/T8t0dmS1NTy9awDVnK7KK87eEf3ykq+nWMeBf TjubAsJcJFn+eLKvjGg2/PLR8K6uBvS+94kdaF6nahh4i4vzku9gU6pxrPZbWQj37s0n RV7ffPVEgFtfW8vXteAubWYAEr7dsqETlWwnH1wN2dtyc8UrZg14jjIl8nHvC1USk6Wk FMCuQgJX3Wm5Yujxcsw1hixFESiMjhU0KcPlrVzkPTjGO/YzyLZaD8HisNWL8ZsSk8s1 Zh+/mkgwWDZ5jS/zu+wwbinzxJPuW0ibPs6QLOthwpS6FIN+fhvfOKJ9ZEscudgwZpCs JANQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zm10si592999ejb.67.2021.06.02.12.06.54; Wed, 02 Jun 2021 12:07:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229769AbhFBTHG (ORCPT + 99 others); Wed, 2 Jun 2021 15:07:06 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:37627 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbhFBTGx (ORCPT ); Wed, 2 Jun 2021 15:06:53 -0400 Received: by mail-pj1-f44.google.com with SMTP id 22-20020a17090a0c16b0290164a5354ad0so4005771pjs.2; Wed, 02 Jun 2021 12:04:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2jsgl46qTXUFETegG4YX4Eozd/vKYgq51F4jK7XaaDw=; b=qrUFRUSkdhOR3lV5nkM1VAwpsSIurtbX4VDOCCTalyBAwEACBB0wnrdgTiTeeLShUg 2Ij2HXYlNanQGlQXiS4/0uRDXCFe8s0gBIcmSyww2NS3G8UGZlCp5mO/4GJuA9CROGA2 e+it5RPObVcuByaiIhXldUSbxfnySjIxD314WPi2OY+lP/+q3K/9Si35DJwg2I5rALjO 9bAA4pFv/ds72ceApWHE+xLKyqp9klPwBf+smAm3I451C2Uz7m8RSxOSBYdqFDCk76hg cUlP7qdkZaWPyiyCsjsJbifO0NgXkHwYLbOhlXkhhaGxzQtcu55cvUfafk4sjHStyB3g 0ZIg== X-Gm-Message-State: AOAM532IuSCEMX4WFsHXlRumFgHNOk3usBYG71TF5PX5cqriFXMWwzWZ aAsBQO15sgekIKrDEXtk13s= X-Received: by 2002:a17:90a:7842:: with SMTP id y2mr7143661pjl.68.1622660648117; Wed, 02 Jun 2021 12:04:08 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id x9sm464893pgp.5.2021.06.02.12.04.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 12:04:07 -0700 (PDT) Subject: Re: [PATCH v11 3/3] scsi: set max_bio_bytes with queue max sectors To: Changheun Lee , hch@infradead.org, Johannes.Thumshirn@wdc.com, alex_y_xu@yahoo.ca, asml.silence@gmail.com, axboe@kernel.dk, bgoncalv@redhat.com, damien.lemoal@wdc.com, gregkh@linuxfoundation.org, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ming.lei@redhat.com, osandov@fb.com, patchwork-bot@kernel.org, tj@kernel.org, tom.leiming@gmail.com, yi.zhang@redhat.com Cc: jisoo2146.oh@samsung.com, junho89.kim@samsung.com, mj0123.lee@samsung.com, seunghwan.hyun@samsung.com, sookwan7.kim@samsung.com, woosung2.lee@samsung.com, yt0928.kim@samsung.com References: <20210602121037.11083-1-nanich.lee@samsung.com> <20210602121037.11083-4-nanich.lee@samsung.com> From: Bart Van Assche Message-ID: <10c02317-7528-bbad-3cfb-75db54d2ab91@acm.org> Date: Wed, 2 Jun 2021 12:04:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210602121037.11083-4-nanich.lee@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/2/21 5:10 AM, Changheun Lee wrote: > Set max_bio_bytes same with queue max sectors. It will lead to fast bio > submit when bio size is over than queue max sectors. And it might be helpful > to align submit bio size in some case. > > Signed-off-by: Changheun Lee > --- > drivers/scsi/scsi_lib.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index 532304d42f00..f6269268b0e0 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -1837,6 +1837,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) > blk_queue_virt_boundary(q, shost->virt_boundary_mask); > dma_set_max_seg_size(dev, queue_max_segment_size(q)); > > + blk_queue_max_bio_bytes(q, queue_max_sectors(q)); > + > /* > * Set a reasonable default alignment: The larger of 32-byte (dword), > * which is a common minimum for HBAs, and the minimum DMA alignment, Has this patch been tested with dm-crypt on top of a SCSI device? I'm concerned that this patch will trigger data corruption with dm-crypt on top because the above change will make the following dm-crypt code fail for a sufficiently large bio: bio_add_page(clone, page, len, 0); When testing dm-crypt on top of this patch series, please change the above dm-crypt code into the following before running any tests: WARN_ON(bio_add_page(clone, page, len, 0) < len); Thanks, Bart.