From patchwork Sun Oct 30 10:02:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 12990 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1726256wru; Sun, 30 Oct 2022 03:05:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7VQ4X+G4saW9cFskKsGMdt6zEDJZpDhq0ZCUxUmnM052HXjawNUQOfK5tAvxrZAlyRtOcd X-Received: by 2002:a17:903:41c5:b0:186:ceff:f805 with SMTP id u5-20020a17090341c500b00186cefff805mr8572349ple.31.1667124315535; Sun, 30 Oct 2022 03:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667124315; cv=none; d=google.com; s=arc-20160816; b=xsGH/qM2uQecQP8zVcsUQH4/6cR4EJ7wESgPrzFRbdQNYfaSK5QdmZh4WwOlJo2k0v ZdV4LPVkdL01oB1oiRz+uP0+1Py4IMmWK9erxfsy8FB/9bnioJbhEfs2l8JLWUOhLIZq UuN//T6s3AR6guoMJ3NxLx9mQ3fUHDI0uZZUKvoGaynKgu1kDwJKZ1m3yX9ZRUYIv5Nh 3Y3hWmfhAy/BjytRXVJDODisCrNbOjHnGIE5c9qfsnfFXz1crd8g+8OUWGKMZwYxIwBE jD2NUMAauuIG32U26o3DJlY9Na/h7mlxwHwhmX8/7EiP79aZjJ+j0Dlwaetl0Ay6fmlq S8hQ== 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=Dagqyailu11jgL84XY9XZ7ZO8PNuYsgn+9sY89yrA6U=; b=qSnob59SECE/8UNLmgULxe/OH5rIX9lNUqtGZfP4k1kxOvH9PGbdoPwOO32Y1hvMJ2 SKjxJoLYmtsp7c2WeRybqcWPxtyVuBvHMxGmT5XxSSoxO/cz4c3zMS4B4YhlFf4LuN+l fAtwHnddNq7zPYvGE7cCGCz7vBX4OID0sKo11tAFSsoA8K8eFJeFDsIYx27NCdNEL6VZ r1a7zOetRYpfrKQunHvKZ6SG+QBt2sF9YuZ/Ku6D0bAlKerpJyZ8X7c30siRktWkvJ4r sGaST45s+0GQrS8Zth16Y9MMygTVBOovYu4ZhppWG5m66oCV99OE5Tevu3Q8hnIvm9Wy ellg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T9Fs+8e8; 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 m5-20020a656a05000000b0046086f8f5d0si6227489pgu.537.2022.10.30.03.05.03; Sun, 30 Oct 2022 03:05:15 -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=T9Fs+8e8; 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 S230089AbiJ3KDx (ORCPT + 99 others); Sun, 30 Oct 2022 06:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbiJ3KDk (ORCPT ); Sun, 30 Oct 2022 06:03:40 -0400 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 B763EBC7 for ; Sun, 30 Oct 2022 03:03:37 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id sc25so22763130ejc.12 for ; Sun, 30 Oct 2022 03:03:37 -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=Dagqyailu11jgL84XY9XZ7ZO8PNuYsgn+9sY89yrA6U=; b=T9Fs+8e83L0bqfPmtM639a+YtCRBr5w4o65ZRTQeHdi6bOvQ2M+n9GYOuQdbiXrPx2 AM10J7h1PtP7OamKIIoXg2/E8f+KqVpVdjkQ4ksPCyM0UH6cLHxTsLuK0nwWhzJUBzQ4 m8r8BAzySbvyPVPufA8mmGAeTT688CWVKfHTy0lv43BgcLCQx7CkvFqULSHisNVXhcDZ gwDsKyBIXwXlEpf58IYHkos+NLInCv+yXoRsLyi3EwosNDDxFxPbnV+eyxja4CMvhyof XHAgfzscqrBXqmg28LYSe3ic1EgEYgadVLmeeKvS5/deKAD/pXnaLy5w0p0B2X64Mndh 7eYg== 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=Dagqyailu11jgL84XY9XZ7ZO8PNuYsgn+9sY89yrA6U=; b=noPx1GEY9o6z86I7OL834OpYCXL0mRVYod2xt2pJ0k2zApPrsuvjvy9RfTB1MIzRLM 4RtrAtRmAQ8H8hnbFhRAz+nyHi7yMLfzMvRdJVRlwTmkhhjqBb1GZi+smQ2Sbqt1S2LT QNVveyeJLcMFW1Gx+ZuG8MTNFYqkaFj5F9agLnh035F8x+sObqcPdgqECHdu5v+XGmQo vt6mdCkjcge/lC5gcClNgkzodf7zWriiCWU3T3Jee5jrcxLTziFNtb84Ryq4h9HvGOQ7 YQbh9KHHwxMpwdy8GS6RetYgmQTvhzR/GMOIAnA2fSi3Fenny2dzRQb1LACP6WXAtFtj 8FFw== X-Gm-Message-State: ACrzQf1TTzIl/FKb7qTQ/InUcLoYvRoYiT1zWnnRUCEGZyGfXP0u4Lr9 xO0nE5HY0/9P2GDmebLNwsiqww== X-Received: by 2002:a17:906:7949:b0:7ac:9917:90b9 with SMTP id l9-20020a170906794900b007ac991790b9mr7337741ejo.536.1667124216223; Sun, 30 Oct 2022 03:03:36 -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 d27-20020a170906305b00b0073d71792c8dsm1666088ejd.180.2022.10.30.03.03.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Oct 2022 03:03:35 -0700 (PDT) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Valente Subject: [PATCH V5 2/8] block, bfq: forbid stable merging of queues associated with different actuators Date: Sun, 30 Oct 2022 11:02:54 +0100 Message-Id: <20221030100300.3085-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221030100300.3085-1-paolo.valente@linaro.org> References: <20221030100300.3085-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 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?1748106546228528291?= X-GMAIL-MSGID: =?utf-8?q?1748106546228528291?= 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. 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 5c69394bbb65..ec4b0e70265f 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5705,9 +5705,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 @@ -5725,7 +5729,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,