Message ID | 20230618160738.54385-1-yukuai1@huaweicloud.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2348107vqr; Sun, 18 Jun 2023 01:10:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yTpQVvvL0/4W9q+lElqqwz8JKXpPOipoanuXXCMThTEAFtBv8pxKcH3Rhfkr3wiyB1kPx X-Received: by 2002:a05:6808:2020:b0:38c:c177:a6bb with SMTP id q32-20020a056808202000b0038cc177a6bbmr10076622oiw.23.1687075806873; Sun, 18 Jun 2023 01:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687075806; cv=none; d=google.com; s=arc-20160816; b=RhGLPo7MQT6c1j15shorlNZzWYXjYT30V5EwVLgMO8XJTdzSDLfk4kyDK5bExTZF/J rk0Llr/Z4mT5raIZ0rB/EC/fJevEvFYXCLNC1QVc7jHyQHQ5FmRKVPrlHpJpzdX0HWqt WXoT89O3H1zONq/uG/afxXkCysKIxf0RHsIwBvZ2GwRtF7e4f+VTZFn97jCLEqtYRNqG irqc8G5ORCIBbM6/nL/435bIzOxP91s7GUQpWIcaG7VDJv9KohyXV4oy8BSRfQorxJ7G w5VKKeva/FnvZY2bnQUJw1UD5+FRDMx9UO/DCRVchbli1muLF7XVO80W8S9PaEYosJXF o3SA== 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 :message-id:date:subject:cc:to:from; bh=GmWuV000+K7jTdMoUBed/lr7opEinnjN/FVPcB5xQUs=; b=bPc3wamh2wpbpqoj03xtZNAvKVhp4y8CDbC9AGLGFgZEK7XmVhah+OqG78dqzqHoHo 8rEJNRTttPVlZzV4PFxxP3XzEgh5Of5CliGqqnSniJWAYO0Li8XVCc4HI/RUncA4eXn4 hMdG21U7FWSDA3DZKrhIhXuciXDcjkmyxyX3YCifcySnh3Gk3usaRgvmpFjvj+d/leFx 2lG+gfbTsMN0ZMdmHBoNFXW3QM+BVRcXf8x5r0/znWv3mG3z5TmZHcmN8DIHHvcZqUeu 5oHTu1+bDGSL2SZHwnjO+aTxhY5PmvGrndVR3FxfoNFsKw+p58zElRMLyKhOd+osangc tN8A== 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 s1-20020a17090ad48100b0024e2bb99e67si5162526pju.7.2023.06.18.01.09.54; Sun, 18 Jun 2023 01:10:06 -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 S229641AbjFRIJO (ORCPT <rfc822;duw91626@gmail.com> + 99 others); Sun, 18 Jun 2023 04:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjFRIJD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 18 Jun 2023 04:09:03 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E595510D7; Sun, 18 Jun 2023 01:09:01 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4QkQX83vb2z4f3nyX; Sun, 18 Jun 2023 16:08:56 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP4 (Coremail) with SMTP id gCh0CgAHoZSXu45kz8rjLw--.30784S4; Sun, 18 Jun 2023 16:08:58 +0800 (CST) From: Yu Kuai <yukuai1@huaweicloud.com> To: bvanassche@acm.org, axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH RFC 0/7] blk-mq: improve tag fair sharing Date: Mon, 19 Jun 2023 00:07:31 +0800 Message-Id: <20230618160738.54385-1-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAHoZSXu45kz8rjLw--.30784S4 X-Coremail-Antispam: 1UD129KBjvJXoW7tF48Xw13GryUuFW7uw48Zwb_yoW8Xry8pF 43ta45Gr4xtrW2vFsxK3y7JFyYvrs3Gr1UGrn7t34Fyrn8Crs3Xr48Ja15AFyxt393AFW7 Kr1UKr98GF1UJ37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv014x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7 xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40E FcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr 0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8v x2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F4 0E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFyl IxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxV AFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_ Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRi Pl1DUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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?1769027201373082095?= X-GMAIL-MSGID: =?utf-8?q?1769027201373082095?= |
Series |
blk-mq: improve tag fair sharing
|
|
Message
Yu Kuai
June 18, 2023, 4:07 p.m. UTC
From: Yu Kuai <yukuai3@huawei.com>
This is not a formal version and not fully tested, I send this RFC
because I want to make sure if people think doing this is meaningful,
before I spend too much time on this.
This patchset tries to refactor how tag is shared:
- patch 2 delay tag sharing from issue io to when get driver tag faild;
- patch 3 support to access which queues/hctxs is sharing tags through
blk_mq_tags;
- patch 4 move the caculation that how many tags is available from
hctx_may_queue() to when queue/hctx start or stop to sharing tags.
- patch 5 record new information that how many times fail to get driver
tag recently; And patch 7 use this to adjust available tags for each
shared queue.
Yu Kuai (7):
blk-mq: factor out a structure from blk_mq_tags to control tag sharing
blk-mq: delay tag fair sharing until fail to get driver tag
blk-mq: support to track active queues from blk_mq_tags
blk-mq: precalculate available tags for hctx_may_queue()
blk-mq: record the number of times fail to get driver tag while
sharing tags
blk-mq: move active request counter to struct tag_sharing
blk-mq: allow shared queue to get more driver tags
block/blk-core.c | 2 -
block/blk-mq-debugfs.c | 6 +-
block/blk-mq-tag.c | 154 ++++++++++++++++++++++++++++++++++++++---
block/blk-mq.c | 10 ++-
block/blk-mq.h | 39 ++++++-----
include/linux/blk-mq.h | 24 ++++---
include/linux/blkdev.h | 13 +++-
7 files changed, 201 insertions(+), 47 deletions(-)
Comments
On 6/18/23 09:07, Yu Kuai wrote: > This is not a formal version and not fully tested, I send this RFC > because I want to make sure if people think doing this is meaningful, > before I spend too much time on this. The approach looks good to me but I'd like to hear from Jens and Christoph what their opinion is about the approach of this patch series before doing an in-depth review. Thanks, Bart.
Hi, Christoph and Jens and anyone who's interested 在 2023/06/20 23:20, Bart Van Assche 写道: > On 6/18/23 09:07, Yu Kuai wrote: >> This is not a formal version and not fully tested, I send this RFC >> because I want to make sure if people think doing this is meaningful, >> before I spend too much time on this. > The approach looks good to me but I'd like to hear from Jens and > Christoph what their opinion is about the approach of this patch series > before doing an in-depth review. > Any suggestions on this topic? It'll be great to hear that if anyone thinks it's meaningful to refactor tag fair sharing. Thanks, Kuai > Thanks, > > Bart. > > . >
On 7/3/23 06:29, Yu Kuai wrote: > 在 2023/06/20 23:20, Bart Van Assche 写道: >> On 6/18/23 09:07, Yu Kuai wrote: >>> This is not a formal version and not fully tested, I send this RFC >>> because I want to make sure if people think doing this is meaningful, >>> before I spend too much time on this. >> The approach looks good to me but I'd like to hear from Jens and >> Christoph what their opinion is about the approach of this patch >> series before doing an in-depth review. >> > Any suggestions on this topic? It'll be great to hear that if anyone > thinks it's meaningful to refactor tag fair sharing. The cover letter of this patch series says "This is not a formal version and not fully tested". If a fully tested version will be posted, I will help with an in-depth review. Thanks, Bart.
Hi, 在 2023/07/04 2:08, Bart Van Assche 写道: > On 7/3/23 06:29, Yu Kuai wrote: >> 在 2023/06/20 23:20, Bart Van Assche 写道: >>> On 6/18/23 09:07, Yu Kuai wrote: >>>> This is not a formal version and not fully tested, I send this RFC >>>> because I want to make sure if people think doing this is meaningful, >>>> before I spend too much time on this. >>> The approach looks good to me but I'd like to hear from Jens and >>> Christoph what their opinion is about the approach of this patch >>> series before doing an in-depth review. >>> >> Any suggestions on this topic? It'll be great to hear that if anyone >> thinks it's meaningful to refactor tag fair sharing. > > The cover letter of this patch series says "This is not a formal version > and not fully tested". If a fully tested version will be posted, I will > help with an in-depth review. Thanks for taking time on this patchset, do you think I need to do following for the formal version, or these improvements can be done later? - current algorithm to borrow tags in patch 7 is very easy and straightforward, it should work fine on simple caces like the case you reported for ufs, but this algorithm should be improved for more complicated cases. - currently borrowed tags will never be returned untill queue is idle, I should figure out a way to return borrowed tags if this queue is not busy, so that other queues can borrow tag from this queue. Thanks, Kuai > > Thanks, > > Bart. > > > . >
On 7/4/23 20:17, Yu Kuai wrote: > - currently borrowed tags will never be returned untill queue is idle, > I should figure out a way to return borrowed tags if this queue is not > busy, so that other queues can borrow tag from this queue. At least for UFS this is a significant disadvantage. If e.g. one SCSI command is sent to the UFS WLUN every 20 seconds and the request queue timeout is 30 seconds then borrowed tags will never be returned. The complexity of this patch series is a concern to me. The complexity of this patch series may be a barrier towards merging this patch series in the upstream kernel. Thanks, Bart.
Hi, 在 2023/07/07 2:43, Bart Van Assche 写道: > On 7/4/23 20:17, Yu Kuai wrote: >> - currently borrowed tags will never be returned untill queue is idle, >> I should figure out a way to return borrowed tags if this queue is not >> busy, so that other queues can borrow tag from this queue. > > At least for UFS this is a significant disadvantage. If e.g. one SCSI > command is sent to the UFS WLUN every 20 seconds and the request queue > timeout is 30 seconds then borrowed tags will never be returned. Ok, thanks for the notice. > > The complexity of this patch series is a concern to me. The complexity > of this patch series may be a barrier towards merging this patch series > in the upstream kernel. Yeah, I see. Thanks for the review! However, all I have in mind will end up make this patch series more complicated, I'll try my best to make the code more readable in the next version. Thanks, Kuai > > Thanks, > > Bart. > > > . >