From patchwork Thu Aug 16 16:51:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 10567877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6BE8D139A for ; Thu, 16 Aug 2018 16:52:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59DAF2B47F for ; Thu, 16 Aug 2018 16:52:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E3622B4A8; Thu, 16 Aug 2018 16:52:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEFB82B47F for ; Thu, 16 Aug 2018 16:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725762AbeHPTwG (ORCPT ); Thu, 16 Aug 2018 15:52:06 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35606 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730216AbeHPTvh (ORCPT ); Thu, 16 Aug 2018 15:51:37 -0400 Received: by mail-wr1-f67.google.com with SMTP id g1-v6so4766564wru.2 for ; Thu, 16 Aug 2018 09:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3znMJbeQWkhLxICWhFJ+SqqBYPCgwq4EtBhKQqaIsps=; b=Qdfz2LOkYSdPyOD6TF+CsHVZ1DQJ6SPsLHaTDZx6EUtQLd23d2RMLG1E8xYieWfmi0 35/AmLoOx83QJWTN1HZ9yU5Lspwkvbq6DJRAwJThsXqJ4BVXAZfMroynE6qWHx4R8AfY gF9ziapCrvqBV2WmxW7cYVl5wifsyBlZgE750= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3znMJbeQWkhLxICWhFJ+SqqBYPCgwq4EtBhKQqaIsps=; b=R8CVUgy60giS99sJHFpizxw1wd43j6a/sxQjVINVQHy3Gtgm9/hXNuW9QUnTcuN2iL Ag+ayZ4blr0fm8us6gMeZc+k7vwuzJm9Xsys7KvRJmZ72XDmER2VGKJM/YtxvtNXOKsh w5grvkefWA5X2+tvr/UnzuLnc8EzBuy9/jfJPaK3xkvPOqzLRbAzWvE8setgjBOfANDy TAnVc+avTsdzGCFPIozJcbwFLVGec3HviIur2JbdN5GIDILsJ91WyyImxUYyKoEP4vQ6 WI2AEupWbRCrxhuCLI0hRZkyqprAcasf0a/Vz6JipeI/JPfh3/gZuYpe2Lf9rDu9aBjv BU+w== X-Gm-Message-State: APzg51CLm5lbQyWc+ogkbYkDqY07IoAjE3ivA92GYfAHc4oJJuEfF2my Aawrucxqjt96RGgNZSyAb5Bs6Q== X-Google-Smtp-Source: AA+uWPwWS/QySF33dPVDrO2aBfFGPIBTJiu2eHnJV1CpMvyar4ur01j4J0pgrG6ck3LRNqv/bL4wJw== X-Received: by 2002:adf:ac41:: with SMTP id v59-v6mr632378wrc.7.1534438318284; Thu, 16 Aug 2018 09:51:58 -0700 (PDT) Received: from localhost.localdomain (146-241-5-103.dyn.eolo.it. [146.241.5.103]) by smtp.gmail.com with ESMTPSA id o3-v6sm30036180wrj.31.2018.08.16.09.51.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Aug 2018 09:51:57 -0700 (PDT) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, Paolo Valente Subject: [PATCH BUGFIX/IMPROVEMENT 2/4] block, bfq: always update the budget of an entity when needed Date: Thu, 16 Aug 2018 18:51:16 +0200 Message-Id: <20180816165118.17402-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180816165118.17402-1-paolo.valente@linaro.org> References: <20180816165118.17402-1-paolo.valente@linaro.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the next child entity to serve changes for a given parent entity, the budget of that parent entity must be updated accordingly. Unfortunately, this update is not performed, by mistake, for the entities that happen to switch from having no child entity to serve, to having one child entity to serve. Signed-off-by: Paolo Valente --- block/bfq-wf2q.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c index dbc07b456059..d558fd26740c 100644 --- a/block/bfq-wf2q.c +++ b/block/bfq-wf2q.c @@ -130,10 +130,14 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd, if (!change_without_lookup) /* lookup needed */ next_in_service = bfq_lookup_next_entity(sd, expiration); - if (next_in_service) - parent_sched_may_change = !sd->next_in_service || + if (next_in_service) { + bool new_budget_triggers_change = bfq_update_parent_budget(next_in_service); + parent_sched_may_change = !sd->next_in_service || + new_budget_triggers_change; + } + sd->next_in_service = next_in_service; if (!next_in_service)