Message ID | 1c4d66ca-fe1a-3d1a-d7f9-4981d2fc9eb1@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3172057wrr; Wed, 23 Nov 2022 19:47:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Fwv5V2b5PFMkfnZskJlXQKIgvhdNxewlYiT3OlPvCh3YUbW+/Jc3HZi16BkMull2wW8ox X-Received: by 2002:a50:d09a:0:b0:46a:48de:c8d7 with SMTP id v26-20020a50d09a000000b0046a48dec8d7mr3499956edd.36.1669261676208; Wed, 23 Nov 2022 19:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669261676; cv=none; d=google.com; s=arc-20160816; b=V1FCf3MZLw2X6GdkTk+drr98NGdLvC0vv0haXbJ//r76UtTicH1u0fAGtQyn2Ua0Ly Gw4iQKNWpjhfqnqWIqL7mIZ4YlvHKiGJfclL64WQt/xvzcPuWMFUbx0Gx8T+S9wacGo/ Ch6Aodv1jHWvyf7NhMGjy7eW18u5gVvf6N5K/vwCDbzAPqODIphkrVsQw/ITeottdfgW D9Cvu3kcAj9UTVJ7+o/ymAPH9EPpYFbn6o+1hsq+XhDKbCWohTOZpLyYzqEsl/jd0UG7 fDtmsXDnukhREwr2BZJzxZgWSLz5QoHfW/5PVaab6RbmhMvnzNntQ057Y4F7gvO2Ffep cw1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:message-id:subject:from:to; bh=sOZYFZOi06X+aNAcO4krZpn69zHzyOwvCXemVe/ZmpI=; b=FnIJ69oMHRfWkHGJPBQR32nurG5ERWEgfB6UTIIsWg2Pg/7lWqKmNtHiNB5a70iGkM fE4TbUiavmaPBOIkr75xRUOw5DDYzr2SXAy0Wha3Qs48utRyq5kW1hxX1tTYAFbk2yGe LtUgj0Etqv5d1aZ/KdZxqcEDQskXt44nCJ/RHERB/EjvQ9lOfj1YShCg4S9Gh2bbYBgS H9KesTgvpiK5GvsGUXOx6UKq13KsTxy3l3/Rf2yh1ry3e58Mgqp0TxZ2A1rNc8qOgA+m B1VsuoEi5oO5Qg8VHSrZH8XF3AJ8TKSk3j6qcumpzonIKpsXvVMjuUBnztf27MOQbJPg iMMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id uz26-20020a170907119a00b007adb6459e64si569759ejb.862.2022.11.23.19.47.31; Wed, 23 Nov 2022 19:47:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiKXDpY (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Wed, 23 Nov 2022 22:45:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiKXDpW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 22:45:22 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388DCD1; Wed, 23 Nov 2022 19:45:21 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4NHkQz486yz4f3lGb; Thu, 24 Nov 2022 11:45:15 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP4 (Coremail) with SMTP id gCh0CgC329jM6H5jbEk5BA--.7917S3; Thu, 24 Nov 2022 11:45:18 +0800 (CST) To: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block <linux-block@vger.kernel.org>, "yukuai (C)" <yukuai3@huawei.com>, "zhangyi (F)" <yi.zhang@huawei.com> From: Yu Kuai <yukuai1@huaweicloud.com> Subject: Why is MEGASAS_SAS_QD set to 256? Message-ID: <1c4d66ca-fe1a-3d1a-d7f9-4981d2fc9eb1@huaweicloud.com> Date: Thu, 24 Nov 2022 11:45:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: gCh0CgC329jM6H5jbEk5BA--.7917S3 X-Coremail-Antispam: 1UD129KBjvdXoW7XF4DGF13KF1fXr18KF1DGFg_yoWkGFcEgr 43G3s2qw4FkrsaqrW7Kr1Yyr4jyF4jvayDCr1qgry7ursrZr13GryDur1UXF43tayv9FsI g3s8ur1ruwn3ZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIxYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwV A0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x02 67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I 0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1lc7I2V7IY0VAS 07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_ GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAF wI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa 7IU1zuWJUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750347731371484085?= X-GMAIL-MSGID: =?utf-8?q?1750347731371484085?= |
Series |
Why is MEGASAS_SAS_QD set to 256?
|
|
Commit Message
Yu Kuai
Nov. 24, 2022, 3:45 a.m. UTC
Hi, While upgrading kernel from 4.19 to 5.10, I found that fio 1 thread 4k sequential io performance is dropped(160Mib -> 100 Mib), root cause is that queue_depth is changed from 64 to 256. commit 6e73550670ed1c07779706bb6cf61b99c871fc42 scsi: megaraid_sas: Update optimal queue depth for SAS and NVMe devices elevator has no effect, specifically io can't be merged in this test case. Hence it doesn't make sense to me to set default queue_depth to 256. Is there any reason why MEGASAS_SAS_QD is changed to 64? Thanks, Kuai
Comments
On 24/11/2022 03:45, Yu Kuai wrote: > Hi, > > While upgrading kernel from 4.19 to 5.10, I found that fio 1 thread 4k > sequential io performance is dropped(160Mib -> 100 Mib), root cause is > that queue_depth is changed from 64 to 256. > > commit 6e73550670ed1c07779706bb6cf61b99c871fc42 > scsi: megaraid_sas: Update optimal queue depth for SAS and NVMe devices > > diff --git a/drivers/scsi/megaraid/megaraid_sas.h > b/drivers/scsi/megaraid/megaraid_sas.h > index bd8184072bed..ddfbe6f6667a 100644 > --- a/drivers/scsi/megaraid/megaraid_sas.h > +++ b/drivers/scsi/megaraid/megaraid_sas.h > @@ -2233,9 +2233,9 @@ enum MR_PD_TYPE { > > /* JBOD Queue depth definitions */ > #define MEGASAS_SATA_QD 32 > -#define MEGASAS_SAS_QD 64 > +#define MEGASAS_SAS_QD 256 > #define MEGASAS_DEFAULT_PD_QD 64 > -#define MEGASAS_NVME_QD 32 > +#define MEGASAS_NVME_QD 64 > > > And with the default nr_requests 256, 256 queue_depth will make the > elevator has no effect, specifically io can't be merged in this test > case. Hence it doesn't make sense to me to set default queue_depth to > 256. > > Is there any reason why MEGASAS_SAS_QD is changed to 64? > > Thanks, > Kuai > Which type of drive do you use? JFYI, in case missed, there was this discussion on SCSI queue depth a while ago: https://lore.kernel.org/linux-scsi/4b50f067-a368-2197-c331-a8c981f5cd02@huawei.com/ Thanks, John
Hi, 在 2022/11/25 20:33, John Garry 写道: > On 24/11/2022 03:45, Yu Kuai wrote: >> Hi, >> >> While upgrading kernel from 4.19 to 5.10, I found that fio 1 thread 4k >> sequential io performance is dropped(160Mib -> 100 Mib), root cause is >> that queue_depth is changed from 64 to 256. >> >> commit 6e73550670ed1c07779706bb6cf61b99c871fc42 >> scsi: megaraid_sas: Update optimal queue depth for SAS and NVMe devices >> >> diff --git a/drivers/scsi/megaraid/megaraid_sas.h >> b/drivers/scsi/megaraid/megaraid_sas.h >> index bd8184072bed..ddfbe6f6667a 100644 >> --- a/drivers/scsi/megaraid/megaraid_sas.h >> +++ b/drivers/scsi/megaraid/megaraid_sas.h >> @@ -2233,9 +2233,9 @@ enum MR_PD_TYPE { >> >> /* JBOD Queue depth definitions */ >> #define MEGASAS_SATA_QD 32 >> -#define MEGASAS_SAS_QD 64 >> +#define MEGASAS_SAS_QD 256 >> #define MEGASAS_DEFAULT_PD_QD 64 >> -#define MEGASAS_NVME_QD 32 >> +#define MEGASAS_NVME_QD 64 >> >> >> And with the default nr_requests 256, 256 queue_depth will make the >> elevator has no effect, specifically io can't be merged in this test >> case. Hence it doesn't make sense to me to set default queue_depth to >> 256. >> >> Is there any reason why MEGASAS_SAS_QD is changed to 64? >> >> Thanks, >> Kuai >> > > Which type of drive do you use? SAS SSDs BTW, I also test with nvme as well, the default elevator is deadline and queue_depth seems too small, and performance is far from optimal. Current default values don't seem good to me... 😒 Thanks, Kuai > > JFYI, in case missed, there was this discussion on SCSI queue depth a > while ago: > https://lore.kernel.org/linux-scsi/4b50f067-a368-2197-c331-a8c981f5cd02@huawei.com/ > > > Thanks, > John > > > . >
On Sat, Nov 26, 2022 at 09:15:53AM +0800, Yu Kuai wrote: > Hi, > > 在 2022/11/25 20:33, John Garry 写道: > > On 24/11/2022 03:45, Yu Kuai wrote: > > > Hi, > > > > > > While upgrading kernel from 4.19 to 5.10, I found that fio 1 thread 4k > > > sequential io performance is dropped(160Mib -> 100 Mib), root cause is > > > that queue_depth is changed from 64 to 256. > > > > > > commit 6e73550670ed1c07779706bb6cf61b99c871fc42 > > > scsi: megaraid_sas: Update optimal queue depth for SAS and NVMe devices > > > > > > diff --git a/drivers/scsi/megaraid/megaraid_sas.h > > > b/drivers/scsi/megaraid/megaraid_sas.h > > > index bd8184072bed..ddfbe6f6667a 100644 > > > --- a/drivers/scsi/megaraid/megaraid_sas.h > > > +++ b/drivers/scsi/megaraid/megaraid_sas.h > > > @@ -2233,9 +2233,9 @@ enum MR_PD_TYPE { > > > > > > /* JBOD Queue depth definitions */ > > > #define MEGASAS_SATA_QD 32 > > > -#define MEGASAS_SAS_QD 64 > > > +#define MEGASAS_SAS_QD 256 > > > #define MEGASAS_DEFAULT_PD_QD 64 > > > -#define MEGASAS_NVME_QD 32 > > > +#define MEGASAS_NVME_QD 64 > > > > > > > > > And with the default nr_requests 256, 256 queue_depth will make the > > > elevator has no effect, specifically io can't be merged in this test > > > case. Hence it doesn't make sense to me to set default queue_depth to > > > 256. > > > > > > Is there any reason why MEGASAS_SAS_QD is changed to 64? > > > > > > Thanks, > > > Kuai > > > > > > > Which type of drive do you use? > > SAS SSDs > > BTW, I also test with nvme as well, the default elevator is deadline and > queue_depth seems too small, and performance is far from optimal. > > Current default values don't seem good to me... 😒 If you want aggressive merge on sequential IO workload, the queue depth need to be a bit less, then more requests can be staggered into scheduler queue, and merge chance is increased. If you want good perf on random IO perf, the queue depth needs to be deep enough to have enough parallelism for saturating SSD internal. But we don't recognize sequential/random IO pattern, and usually fixed queue depth is used. Thanks, Ming
Hi, Ming 在 2022/11/26 10:18, Ming Lei 写道: > > If you want aggressive merge on sequential IO workload, the queue depth need > to be a bit less, then more requests can be staggered into scheduler queue, > and merge chance is increased. But if nr_requests >= queue_depth, it seems to me elevator will have no effect, no request can be merged or sorted by scheduler, right? > > If you want good perf on random IO perf, the queue depth needs to > be deep enough to have enough parallelism for saturating SSD internal. > > But we don't recognize sequential/random IO pattern, and usually fixed > queue depth is used. Is it possible to use none elevator and set large queue_depth if nvme is used in this case? Thansk, Kuai > > Thanks, > Ming > > . >
在 2022/11/26 14:08, Yu Kuai 写道: > Hi, Ming > > 在 2022/11/26 10:18, Ming Lei 写道: >> >> If you want aggressive merge on sequential IO workload, the queue >> depth need >> to be a bit less, then more requests can be staggered into scheduler >> queue, >> and merge chance is increased. > > But if nr_requests >= queue_depth, it seems to me elevator will have no > effect, no request can be merged or sorted by scheduler, right? Sorry that should be nr_requests <= queue_depth. >> >> If you want good perf on random IO perf, the queue depth needs to >> be deep enough to have enough parallelism for saturating SSD internal. >> >> But we don't recognize sequential/random IO pattern, and usually fixed >> queue depth is used. > > Is it possible to use none elevator and set large queue_depth if nvme is > used in this case? > > Thansk, > Kuai >> >> Thanks, >> Ming >> >> . >> > > . >
On Sat, Nov 26, 2022 at 02:08:02PM +0800, Yu Kuai wrote: > Hi, Ming > > 在 2022/11/26 10:18, Ming Lei 写道: > > > > If you want aggressive merge on sequential IO workload, the queue depth need > > to be a bit less, then more requests can be staggered into scheduler queue, > > and merge chance is increased. > > But if nr_requests >= queue_depth, it seems to me elevator will have no > effect, no request can be merged or sorted by scheduler, right? Yeah. If nr_requests <= queue_depth, every request can be queued to driver/device, so requests won't be merged by scheduler. But plug merge still works if IOs are submitted as batch. > > > > If you want good perf on random IO perf, the queue depth needs to > > be deep enough to have enough parallelism for saturating SSD internal. > > > > But we don't recognize sequential/random IO pattern, and usually fixed > > queue depth is used. > > Is it possible to use none elevator and set large queue_depth if nvme is > used in this case? Yeah, if the storage is SSD, usually none with bigger queue_depth should help, and usually 256 should be enough to saturate one single SSD for one well implemented driver. Thanks Ming
Hi, 在 2022/11/27 17:42, Ming Lei 写道: > On Sat, Nov 26, 2022 at 02:08:02PM +0800, Yu Kuai wrote: >> Hi, Ming >> >> 在 2022/11/26 10:18, Ming Lei 写道: >>> >>> If you want aggressive merge on sequential IO workload, the queue depth need >>> to be a bit less, then more requests can be staggered into scheduler queue, >>> and merge chance is increased. >> >> But if nr_requests >= queue_depth, it seems to me elevator will have no >> effect, no request can be merged or sorted by scheduler, right? > > Yeah. > > If nr_requests <= queue_depth, every request can be queued to > driver/device, so requests won't be merged by scheduler. > > But plug merge still works if IOs are submitted as batch. Yes, io can still be merged by plug. I just find it a little werid to set default elevator as deadline, and default queue_depth to 256. Which means deadline here is useless. > >>> >>> If you want good perf on random IO perf, the queue depth needs to >>> be deep enough to have enough parallelism for saturating SSD internal. >>> >>> But we don't recognize sequential/random IO pattern, and usually fixed >>> queue depth is used. >> >> Is it possible to use none elevator and set large queue_depth if nvme is >> used in this case? > > Yeah, if the storage is SSD, usually none with bigger queue_depth should > help, and usually 256 should be enough to saturate one single SSD for > one well implemented driver. Yes, I'm testing with multiple SSDs / NVMEs, and I can't get optimal performance by default. Thanks, Kuai > > > Thanks > Ming > > . >
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index bd8184072bed..ddfbe6f6667a 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -2233,9 +2233,9 @@ enum MR_PD_TYPE { /* JBOD Queue depth definitions */ #define MEGASAS_SATA_QD 32 -#define MEGASAS_SAS_QD 64 +#define MEGASAS_SAS_QD 256 #define MEGASAS_DEFAULT_PD_QD 64 -#define MEGASAS_NVME_QD 32 +#define MEGASAS_NVME_QD 64 And with the default nr_requests 256, 256 queue_depth will make the