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: 13013679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B9B0C4332F for ; Thu, 20 Oct 2022 15:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbiJTP1h (ORCPT ); Thu, 20 Oct 2022 11:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbiJTP1e (ORCPT ); Thu, 20 Oct 2022 11:27:34 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B94C1C2E8C for ; Thu, 20 Oct 2022 08:27:11 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id f11so35126435wrm.6 for ; Thu, 20 Oct 2022 08:27:11 -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=4mtr5fEGpXgd5Hxs+Ly6+zmaLtbK87YmujiP4Yk33zf8Ouihlel2ZhET6Lll6qEqr6 1EK8XZyM31RJSY+z4Rfh0Rxz9Sjdfkr7UQRB1U5YfGogIeX9rFvFx51hMwPtBmbU5XaX eII4fBGng0/MR/r7i1vtryix5Dr3CBvjGoWUGwCUQUcx0EY1Dv0NDSEa1ctVMRNFGG3/ ixBOdtP+Avlbr1UQeP2KQjs7MeBBX/YGEhp6Tdr1ledLR6GDS8VmOG6IBnPyWfUQqcMK iHERGxQZ+64Pv9KRHDAvuldMI/gvs21oCi7d8yITF0TwgXSlLv8IrirPp8qxsUqiFcE5 wnnA== X-Gm-Message-State: ACrzQf3h7LsLE892P8a7b50iG/dvsY0cjA5fyhZhcG4jhiOvjw1T3q9g HqcLKGNm7em2ApI3SDxh3Q3UFQ== X-Google-Smtp-Source: AMsMyM4oA6HhvgnlogyImkQrOfRO3Ys9ayWZkrzf3suZbRFQAxgsGcGid84N/EdgUMZWQp8I2HjwzA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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; };