From patchwork Thu Oct 20 15:26:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 6260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp174855wrr; Thu, 20 Oct 2022 08:31:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ho/dsXzLFNjGyIdZKHA6Cg7HUYEEXyKY6YSpB66bpjoxCntVkod0TzxehNC+FkFfPEMpK X-Received: by 2002:a17:906:fd84:b0:730:acee:d067 with SMTP id xa4-20020a170906fd8400b00730aceed067mr11686096ejb.206.1666279864216; Thu, 20 Oct 2022 08:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666279864; cv=none; d=google.com; s=arc-20160816; b=QXbt/MzClI3rXbw/GZyJ5XO/TfPisnuOIGqwH1cZJs4h+Vw3NSXYqVbo3BJMmPU3HW lPg7wLn7lQUSFsQa31E/N8ThfbbCAwqMnbZz8puhdkNHmTYbGFuoxIBuGsSvYs5yxefY 1kpZ8kFHNYbdUmXy+x3xYU1nXOFkfDWEMbBIFmwKBD5lDV+aajKSi4OLsLU2RR4RiTZW 758lyfRL69Jo6CgG9iqOxhr7XhbsNdgusy4Lua5GlNKEDnMBkIB/eOUrTf3dJDF5wNPU aN5cEFsvHsiCHFTyTZb4P3IfxNOSTYMBfyxuUqCVrRCIdaByGvcrV8sYbGkBgslOUiKQ 6KeA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7zxWQgonKn5MWkaLJMrIQViISoHFeZLtreMWqdp6ndU=; b=iv2DJcXSE8fl0R3VEpyfTGvFDv4REjGCtSTcrBeEWXtAXtOQzTwQ35upSiyJvksz+X SAW5iIwl5udEsh8Yt4vZGASocFb0EHQ5WJgSwa3NQpvCSYssLxTqzw7/owvRTWKR8Qyc Es2Vv5ocQtbi2cgrnnYLST3hsbqgeYvcALpqACu+BeL/nZjqk0HfvCU5fQ2wZ+9N5Jd1 YXnFx+2/yuT6BdLkg27rAfUl90i2RPUUcjjEEMwUoal9J6lpu9h+debYRgutxKyRnWVo I7wYyMr+19EQEPchSkG70z2O6XHp+sKwTinO4KwE1W2Qy6Hmp/FP+6OzIZRtkhnl7NNj 5tig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f0lZkWCy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz14-20020a0564021d4e00b0044e987f3a34si19167954edb.489.2022.10.20.08.30.39; Thu, 20 Oct 2022 08:31:04 -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; dkim=pass header.i=@linaro.org header.s=google header.b=f0lZkWCy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230407AbiJTP1r (ORCPT + 99 others); Thu, 20 Oct 2022 11:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiJTP1e (ORCPT ); Thu, 20 Oct 2022 11:27:34 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9DC1C2F16 for ; Thu, 20 Oct 2022 08:27:10 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id v1so5858635wrt.11 for ; Thu, 20 Oct 2022 08:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7zxWQgonKn5MWkaLJMrIQViISoHFeZLtreMWqdp6ndU=; b=f0lZkWCyqGhDZDFm8YvGkv0emgFYRjszpZ7jZa0DcOnVHcvvaXqwMqE+pvmsCsRWoL lI42O0+7+iDc8hwrzErjIfCKpHZcrk4qKtrbymZfxXJ9Qe/ukmegsmha/uHlYPSGxiqU ZnUR4foHHGfMqUFzWL7vorxxxRSnVSSrWUwuOos3MQ54iSB7jyNXOLl9TBXKfPUyVv86 anEtKTfxoF1AUvZ2ORGDmKebFZqK0X/Y2VHOQWggfwrek5a2q/4ZOcZyMe6aGVHvCils I2d9bU4pBGk863Ch2BP52vd+if11N83U2NCcv2OxsU/O9aT4TIMM/jRi3LyGwCtZQOYL tK4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7zxWQgonKn5MWkaLJMrIQViISoHFeZLtreMWqdp6ndU=; b=J3qIjKH5JLU0JTCOq3uXH4o5SGltIIQAyCcXfBaiKBoWvn+kJsDmmCXmMJsZe3tIuz UAaJiBtMsg2e5rjCY77B6yPE2xxYCvsp5J1I4vs0M7BuTygHm3K5l7N9o3tuPdMxnBf9 0XlJ5ve+tqJ71p+1VxUy+poX447qNCWrIvEk3hg7bufPIq6THuc5eeirh3BCscDl3Yes ywUq/cj2G88yyGg8sFPsZYm5Ncav6HKThMAbYj2iQF28q5VcCe0r2JADqfdrIfvY0Nrv 4cjlRDWGYBsfjSCAHusMZhBwlr6ybUhbUx8OkjKH+nDnt5Roi+jvG0I2Kp+LO6D9buO7 DGDg== X-Gm-Message-State: ACrzQf2ZWcvWaqghdmy++HuRXHKS0BLVlkR4trij0FewlkulFknQGif1 VO7MJtEwJinvzxLppWQoqyLCng== X-Received: by 2002:a05:6000:1e07:b0:236:759:929d with SMTP id bj7-20020a0560001e0700b002360759929dmr2300018wrb.199.1666279619903; Thu, 20 Oct 2022 08:26:59 -0700 (PDT) Received: from MBP-di-Paolo.station (net-2-35-55-161.cust.vodafonedsl.it. [2.35.55.161]) by smtp.gmail.com with ESMTPSA id l10-20020a1ced0a000000b003c409244bb0sm134337wmh.6.2022.10.20.08.26.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2022 08:26:59 -0700 (PDT) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, glen.valante@linaro.org, arie.vanderhoeven@seagate.com, rory.c.chen@seagate.com, Davide Zini , Paolo Valente Subject: [PATCH V4 5/8] block, bfq: split also async bfq_queues on a per-actuator basis Date: Thu, 20 Oct 2022 17:26:40 +0200 Message-Id: <20221020152643.21199-6-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221020152643.21199-1-paolo.valente@linaro.org> References: <20221020152643.21199-1-paolo.valente@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747221074881932676?= X-GMAIL-MSGID: =?utf-8?q?1747221074881932676?= From: Davide Zini Similarly to sync bfq_queues, also async bfq_queues need to be split on a per-actuator basis. Signed-off-by: Paolo Valente Signed-off-by: Davide Zini --- block/bfq-iosched.c | 41 +++++++++++++++++++++++------------------ block/bfq-iosched.h | 8 ++++---- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 80fb20fe0e41..7c9b5cae05b5 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2673,14 +2673,16 @@ static void bfq_bfqq_end_wr(struct bfq_queue *bfqq) void bfq_end_wr_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg) { - int i, j; - - for (i = 0; i < 2; i++) - for (j = 0; j < IOPRIO_NR_LEVELS; j++) - if (bfqg->async_bfqq[i][j]) - bfq_bfqq_end_wr(bfqg->async_bfqq[i][j]); - if (bfqg->async_idle_bfqq) - bfq_bfqq_end_wr(bfqg->async_idle_bfqq); + int i, j, k; + + for (k = 0; k < bfqd->num_actuators; k++) { + for (i = 0; i < 2; i++) + for (j = 0; j < IOPRIO_NR_LEVELS; j++) + if (bfqg->async_bfqq[i][j][k]) + bfq_bfqq_end_wr(bfqg->async_bfqq[i][j][k]); + if (bfqg->async_idle_bfqq[k]) + bfq_bfqq_end_wr(bfqg->async_idle_bfqq[k]); + } } static void bfq_end_wr(struct bfq_data *bfqd) @@ -5613,18 +5615,18 @@ static void bfq_init_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq, static struct bfq_queue **bfq_async_queue_prio(struct bfq_data *bfqd, struct bfq_group *bfqg, - int ioprio_class, int ioprio) + int ioprio_class, int ioprio, int act_idx) { switch (ioprio_class) { case IOPRIO_CLASS_RT: - return &bfqg->async_bfqq[0][ioprio]; + return &bfqg->async_bfqq[0][ioprio][act_idx]; case IOPRIO_CLASS_NONE: ioprio = IOPRIO_BE_NORM; fallthrough; case IOPRIO_CLASS_BE: - return &bfqg->async_bfqq[1][ioprio]; + return &bfqg->async_bfqq[1][ioprio][act_idx]; case IOPRIO_CLASS_IDLE: - return &bfqg->async_idle_bfqq; + return &bfqg->async_idle_bfqq[act_idx]; default: return NULL; } @@ -5798,7 +5800,8 @@ static struct bfq_queue *bfq_get_queue(struct bfq_data *bfqd, if (!is_sync) { async_bfqq = bfq_async_queue_prio(bfqd, bfqg, ioprio_class, - ioprio); + ioprio, + bfq_actuator_index(bfqd, bio)); bfqq = *async_bfqq; if (bfqq) goto out; @@ -7015,13 +7018,15 @@ static void __bfq_put_async_bfqq(struct bfq_data *bfqd, */ void bfq_put_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg) { - int i, j; + int i, j, k; - for (i = 0; i < 2; i++) - for (j = 0; j < IOPRIO_NR_LEVELS; j++) - __bfq_put_async_bfqq(bfqd, &bfqg->async_bfqq[i][j]); + for (k = 0; k < bfqd->num_actuators; k++) { + for (i = 0; i < 2; i++) + for (j = 0; j < IOPRIO_NR_LEVELS; j++) + __bfq_put_async_bfqq(bfqd, &bfqg->async_bfqq[i][j][k]); - __bfq_put_async_bfqq(bfqd, &bfqg->async_idle_bfqq); + __bfq_put_async_bfqq(bfqd, &bfqg->async_idle_bfqq[k]); + } } /* diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h index 713c6559fe91..5fca86a82411 100644 --- a/block/bfq-iosched.h +++ b/block/bfq-iosched.h @@ -980,8 +980,8 @@ struct bfq_group { void *bfqd; - struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS]; - struct bfq_queue *async_idle_bfqq; + struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS][BFQ_MAX_ACTUATORS]; + struct bfq_queue *async_idle_bfqq[BFQ_MAX_ACTUATORS]; struct bfq_entity *my_entity; @@ -997,8 +997,8 @@ struct bfq_group { struct bfq_entity entity; struct bfq_sched_data sched_data; - struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS]; - struct bfq_queue *async_idle_bfqq; + struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS][BFQ_MAX_ACTUATORS]; + struct bfq_queue *async_idle_bfqq[BFQ_MAX_ACTUATORS]; struct rb_root rq_pos_tree; };