Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp478203imi; Fri, 22 Jul 2022 03:17:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v2zMmBirHqRK/O3jdgWiQ4YXRkM3GMTReHPxzU0vx+1rgLb7ylLAGajoVFxhvUnVDo33xR X-Received: by 2002:a17:903:1c7:b0:16c:4f00:65df with SMTP id e7-20020a17090301c700b0016c4f0065dfmr2673510plh.158.1658485050085; Fri, 22 Jul 2022 03:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658485050; cv=none; d=google.com; s=arc-20160816; b=TyDYIEQuId43pzWYLqCNNdsIetRyLUntlZB0Uffrg4wAzh/dALiKHd3Y6MeQTJ7wyH cXPVp7b/V7AalOyxFKwHYAUxULvW/PPLpf9sjA2T/wIhN9RkWqMDLHQWNVXTLtsG27Ex yuoeW8ZZsCPawB4MJy+AluHqPzytOJLaBjc+yiWTgsREi7T/6dJjVisolwY14K/KMFgc 5h9xpAezTpQdgLWJvG9XjLhgnhRMZywsGU9UbkiTCh4YW+trtA2wU6t4Avi2kjNSI5zE u7ix7eDRII5V0gm6aDmAZSXi8gqki2fgR5rckiEVuBPCPa0+ujJN9Skmx847g2TP9xih /fCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=0BaBSnOl7vFUtIKhVNve96wnic6QDZjrngVYCIEuntQ=; b=pRLwAfwJZSF/R+kFSknv5/jD1hIaGddHLGjOLXQGQcB8jkuawmXqX5wGNFCfW0Y8bC w6iWaszQcZ+EzyvH4vGDgSz5gsprOGMvPMsAH9z7fQo99ZMQZTr7ezFuzpKtTLNfTnpG kPEVZ6KD1wpPV01XX74vD7p7r/LIQdKVmgfzI5oCsgP/r7IFIxJYrRwLZoODnwAcOCNH F2PeGVF5k28xdUe3tj7nFqolwOB8lZqXv8350a74fDtbv3ZTjgmJBRLk04HwgI9UwWaQ VkNWWh/ADQJEXzDrvdnSqv7agQQqVsEJvKyZNru/wipejwIDZ/4nEKLpEGwsSiwuaoQ6 OXiQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g23-20020a635217000000b003aa90e6d50bsi4621720pgb.45.2022.07.22.03.17.12; Fri, 22 Jul 2022 03:17:30 -0700 (PDT) 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 S235044AbiGVJvu (ORCPT + 99 others); Fri, 22 Jul 2022 05:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235586AbiGVJvh (ORCPT ); Fri, 22 Jul 2022 05:51:37 -0400 Received: from smtpproxy21.qq.com (smtpbg703.qq.com [203.205.195.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B1C100E for ; Fri, 22 Jul 2022 02:51:34 -0700 (PDT) X-QQ-mid: bizesmtp68t1658483488tiq7mmxl Received: from eureka.localdomain ( [123.124.208.226]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 22 Jul 2022 17:51:21 +0800 (CST) X-QQ-SSF: 01400000002000B0D000000A0000020 X-QQ-FEAT: u333Yk6K//cJf6U3Gg35wNrITo20vet63t8xhIw9HlBoV0teoSgOYTlAyOa/V qkJYzrZKYsHDG0fLMX9OAHn4pTepV4VwPQOlO01nTdipDxzGs7BKJPPdqGKgmfg/5gYNvRQ zAwwPdQ3CsGH2IsdvQlqe0iP04U2qsCqtmQESwk2umYpdstqIPs2S1F90uWWm9wNKRlodmR /2nHcGBmezFWe6nNDMgWMSEnkpn5AU15KhhL0vejZ680TPMgkBdQmm6o56P+Py5gvOsfmxF sODPTnDYNyO7OOd0rfhhrbfzt0FF0HxWOUh2WHsdiNYVw38lDknKptMgg0vxS6bdPnOxCvn acqHFT6t+TyeBGkpOx9hSC7xZADuujfwswzWCDoez3AhvaKf4dSQ7FgZ8Y2UgqEHVgr7tCy pBRvDhZXSnCrtLLIEVrBLQ== X-QQ-GoodBg: 1 From: Wang You To: axboe@kernel.dk, bvanassche@acm.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, hch@lst.de, jaegeuk@kernel.org, fio@vger.kernel.org, ming.lei@redhat.com, wangyoua@uniontech.com, wangxiaohua@uniontech.com Subject: [PATCH v2 0/2] Improve mq-deadline performance in HDD Date: Fri, 22 Jul 2022 17:51:18 +0800 Message-Id: <20220722095120.371212-1-wangyoua@uniontech.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign9 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi jens, We already know that batching requests can increase the storage performance of some devices, but after testing, I found that it will reduce the performance of some low and medium speed devices when using the scheduler (especially mq-deadline), such as rotational disks connected to a raid. In order to balance the performance difference between different devices, a more sophisticated mechanism may be needed to control the number of batching (such as sometimes 1 is better), but obviously this is not easy. At the same time I noticed that when the mq-deadline scheduler select a request for a higher sector outside the batch, deadline_fifo_request is used to select the request within the fifo and restart the batch. Selecting a request from a fifo tends to satisfy the request's timeline, but it is not always very urgent. So in the case of no expire, can the selection strategy of the first request in the batch be changed? Because in devices with rotation characteristics, proper sector access order is beneficial to performance. This patch series includes the following two parts: - Added a temporary sys interface nr_sched_batch to control the number of batching requests. - Added a deadline_head_request function to select the request from the first of the red-black tree instead of the fifo when appropriate. Thanks, Wang. Wang You (2): block: Introduce nr_sched_batch sys interface block/mq-deadline: Prioritize first request block/blk-mq-sched.c | 4 +++- block/blk-sysfs.c | 32 +++++++++++++++++++++++++++++++ block/mq-deadline.c | 43 +++++++++++++++++++++++++++++++++++++++--- include/linux/blkdev.h | 1 + 4 files changed, 76 insertions(+), 4 deletions(-) -- 2.27.0