Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3819642rwj; Tue, 20 Dec 2022 02:17:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf62M2Vt+CIR4VEsGTCTf8AsVbflHPn4HPie/jiuIXh17NHTJ8cTvXWjzZnJskodu8lU1pip X-Received: by 2002:a17:907:2458:b0:7c1:1e5a:ed10 with SMTP id yw24-20020a170907245800b007c11e5aed10mr56606143ejb.8.1671531456311; Tue, 20 Dec 2022 02:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671531456; cv=none; d=google.com; s=arc-20160816; b=twpTtxayUuDqo/og+Yfkf5zzk3MH/EwPSvQskMbygqtyg7XmyWdH8HMIxLHI+le8Rp pN8DLAypqa38iCoZlWoJZLoitWCgUKNMQnFFzuOd7ag+3X60jhyuUExq6JzScGG/t5Mr WEfJBqx/DDKqoWQKJKRuBmwdJJR9SIkO3mVEj9our3rmuHMNjv+HZz+4gR9PuD6xXXZr 066akrfebzHky/0g+igdZCrPKPPnZOxgNKvogr+Ts6moEUDtQG7u+G6hBjkERYkrWDl+ ch98GpCEb1vYMPTo9I3BCV/TQz2I5MHR8aoBOK/slTXsMhB/IeS4IAvyAF+k8e0p0siW Q/Jw== 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=J1vlVQT7oPM9UWQWJ7LqRXY6nAAmmhTt3SmiNtspLrs=; b=DevUiqqEF1lhLZC8SI7JhJ1ff5CYNceh24j4uQLqHKa5dITAf4JvWdfpjKmBXBxWeW vecIOeF8y7PLRWSQdKGdzVp/UbesiBrmP35sYoau6n6E/08z9aZO/g8y5o9jHGjmk4TR yIi+Wp8a9UyyUsqIWa9DgqDG6Npo45Pe67zphVAf7MEDtwDgtfbOw/zxjekIY3aI8u+q eVcM8qOiJLbH0fraBESEEKCKNRq2HFrE2JY/SppoMfslaq0jP3g3a/JO20f99nI8R+kb NhTt99UaSKvbVKH3JbIAoe+QmI5K71J7azuNWjBypqSS4H13x2dw0NzqJzZ5do8i3yMX aaXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OsPsOeL4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm17-20020a170907949100b007c1727f7c65si11835022ejc.470.2022.12.20.02.17.20; Tue, 20 Dec 2022 02:17:36 -0800 (PST) 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=OsPsOeL4; 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 S233554AbiLTJuq (ORCPT + 70 others); Tue, 20 Dec 2022 04:50:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233462AbiLTJu1 (ORCPT ); Tue, 20 Dec 2022 04:50:27 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 835D61583C for ; Tue, 20 Dec 2022 01:50:25 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id vv4so27960289ejc.2 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=h8x00XLjntHFoGfspueEyJCFrnku7Pt5u7UV/hoD7JqLauYI+xbzSRZIfVeiL8/Dao fmMzTsup2E0CDMxbkWnr0Un9D58vgbLE33z/RdKR86jj+bF7zZhqawJ4VeltdwYOlHAU 82mmDowBen5OjRO+PRi9uQhLwSOng9QkX5UopzMgh3rJaMiBXE+hZFXzjaQOnBfhYn7o BKS/V19mTkEDASE7Uf+MhZnJmouct77nm5EXuilklEzxBHsqQLz6I7JTb+q4SkGLMQgL KmM8cnEpquGDseceTI7DnBtjZh0bJn1tCyYtIwfsVz2dLWhmGN88Sj2BrXdF9iWhjlBh 7xRg== X-Gm-Message-State: ANoB5pnwMOclMdEs0bSRJVWFAmoMTpgN1aSk6dfJ6Xac1IOOc2d237Xg B/nzj0cx0B3GNN3YXvfrImOPpQ== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 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, -- 2.20.1