From patchwork Tue Dec 20 09:50:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 13077695 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 E2113C10F1E for ; Tue, 20 Dec 2022 09:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233482AbiLTJuf (ORCPT ); Tue, 20 Dec 2022 04:50:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233289AbiLTJu1 (ORCPT ); Tue, 20 Dec 2022 04:50:27 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8122A1583A for ; Tue, 20 Dec 2022 01:50:25 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id bj12so27793108ejb.13 for ; Tue, 20 Dec 2022 01:50:25 -0800 (PST) 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=J1vlVQT7oPM9UWQWJ7LqRXY6nAAmmhTt3SmiNtspLrs=; b=OsPsOeL4C5sSq5K8HgMGBMVaRPNqxORKprby5lywWjtIRU8lkF3lby7jTAV+K68hYQ fJ1mEy0NGJcketjis9ZXb021nr3ODJtdqHY2yfswSFX8ne5UZhxhE+boBziUtWygVxqf 1Jm/yCdRYgDiMV0s/jUM6Dfw2PmNqlHv6vqln/WRzT9TlU7bDIoavCniG3wYHoqIDroy O35lJuNNX5OmF4rwwUalkRkMknSUonv2BSDkSz7LOe1vVaIU7mNzpaiL+Nmitb1asxct 6hiMUjlMA4D9GAP5bJhTZ8TOGWW5ta5nxLWDfXhkrqOxcjnPTMluidsRC3wUsFXN45BH W08Q== 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=J1vlVQT7oPM9UWQWJ7LqRXY6nAAmmhTt3SmiNtspLrs=; b=tb6RARneGUE66IeH22EN9/6Uk2UQ0zK8iWuvWUEZT7dIHGrTUKCscXoMfavJFtmDFj o7UqlHGpwBf/v8LGF98ks5s/p1l+l19cuoSYRjayZt57993DFMUmkRhrmNkIpORypi5R bFq+5C9LqBYDUIY4hUJdS3TLQewpuHmZmnhaCOE26ZPUkuvUtnmalSkSsj9t1g2620pY use66rQJlOOd331wGt30R0zZ4SXbRTXIKFnLhN4/fC83PRyv7zBFwc/3/8Gwk6P3s0R+ aipzr9k3cJD3fA07yeuREjHzr0GyJ2yOSPC7QCjYlLygQauKBg7HIk97jhhXyBjBrelE 0PlA== X-Gm-Message-State: ANoB5pmfHq/N0Gm1/7Tfo/NuxNHyP/yeuuNE+tC77aUttrLpO2GF9vOB 2f9f6X0HaxlD2kZKPEQXqmJEcXmTwlFTs4y8 X-Google-Smtp-Source: AA0mqf7QjrWHU0sYLULomd6L5+M5dBmp5psjUrmWrNASLQFnP9DyR8h85xKB447GaEA++Y/3bGSpRw== X-Received: by 2002:a17:906:375a:b0:7c1:709d:fa49 with SMTP id e26-20020a170906375a00b007c1709dfa49mr42226524ejc.18.1671529824057; Tue, 20 Dec 2022 01:50:24 -0800 (PST) Received: from MBP-di-Paolo.station (net-93-70-85-0.cust.vodafonedsl.it. [93.70.85.0]) by smtp.gmail.com with ESMTPSA id c2-20020a17090618a200b0082ea03c395esm1669207ejf.74.2022.12.20.01.50.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2022 01:50:23 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, arie.vanderhoeven@seagate.com, rory.c.chen@seagate.com, glen.valante@linaro.org, Paolo Valente , Damien Le Moal Subject: [PATCH V11 2/8] block, bfq: forbid stable merging of queues associated with different actuators Date: Tue, 20 Dec 2022 10:50:07 +0100 Message-Id: <20221220095013.55803-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221220095013.55803-1-paolo.valente@linaro.org> References: <20221220095013.55803-1-paolo.valente@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org If queues associated with different actuators are merged, then control is lost on each actuator. Therefore some actuator may be underutilized, and throughput may decrease. This problem cannot occur with basic queue merging, because the latter is triggered by spatial locality, and sectors for different actuators are not close to each other. Yet it may happen with stable merging. To address this issue, this commit prevents stable merging from occurring among queues associated with different actuators. Reviewed-by: Damien Le Moal Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 95125c8d52e7..79cdc4dbf76c 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5642,9 +5642,13 @@ static struct bfq_queue *bfq_do_or_sched_stable_merge(struct bfq_data *bfqd, * it has been set already, but too long ago, then move it * forward to bfqq. Finally, move also if bfqq belongs to a * different group than last_bfqq_created, or if bfqq has a - * different ioprio or ioprio_class. If none of these - * conditions holds true, then try an early stable merge or - * schedule a delayed stable merge. + * different ioprio, ioprio_class or actuator_idx. If none of + * these conditions holds true, then try an early stable merge + * or schedule a delayed stable merge. As for the condition on + * actuator_idx, the reason is that, if queues associated with + * different actuators are merged, then control is lost on + * each actuator. Therefore some actuator may be + * underutilized, and throughput may decrease. * * A delayed merge is scheduled (instead of performing an * early merge), in case bfqq might soon prove to be more @@ -5662,7 +5666,8 @@ static struct bfq_queue *bfq_do_or_sched_stable_merge(struct bfq_data *bfqd, bfqq->creation_time) || bfqq->entity.parent != last_bfqq_created->entity.parent || bfqq->ioprio != last_bfqq_created->ioprio || - bfqq->ioprio_class != last_bfqq_created->ioprio_class) + bfqq->ioprio_class != last_bfqq_created->ioprio_class || + bfqq->actuator_idx != last_bfqq_created->actuator_idx) *source_bfqq = bfqq; else if (time_after_eq(last_bfqq_created->creation_time + bfqd->bfq_burst_interval,