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: 144429 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2305763ljj; Thu, 16 Aug 2018 09:52:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy6ZEt0Oe+s0Gq91KOULOD6khrRMYZu0iDkgcR9Ev6j74R6sMTEW0weVDxDA2Bf78Ix9tvz X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr29764039plp.194.1534438323421; Thu, 16 Aug 2018 09:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534438323; cv=none; d=google.com; s=arc-20160816; b=tHaaTvTRI+yC+CJVRENvvrlQ72+f7bPzJ2ObZ2fcFZ1eqzCgpHB6Dt4nH6tqft5Ufi 8vI/Z+6fHEEOYVQn62vG1tPNugxaQ63SnvenrZM0VkFrVEtuST+8VuQ5KpX56qe50r0g DOiBkGvl3dZejxREyZRp2hdUFT8vUJZd+Xc6jD07I288/RW20Lta+69hRAwpBzyx6AAd N5kX665R3/dvdiJhLhjbKxKsGECv2averhXVwYfvPchSyCAF99x9oWGqpuhGotLjzhSy KGYF6v9+7eUaQ4nPGyL6vF2wtFxbYAvxT4vFCxPnzia660cott6oXbgNSD9kIMKI0uzK 0yAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3znMJbeQWkhLxICWhFJ+SqqBYPCgwq4EtBhKQqaIsps=; b=Y/vUKqwlG0GYtIQkI+U5lq6KQCcDB2P0a2ZnlFFTeImLqxAGALhUrfeRdweAkpS+Ak yCoJNs48/ua41iZPzLx70uyxfsGtCr/+FlQ4dsfFO49ooveOiUXb2ZPTPCIyEru5A6/I wN28/0Rvk/WlHPa99TLRhCfqlRUHVJqGT9FGYonkj5HfpxNzxmeaLpFv2Sz4+AzL45k/ zVHtdUmkXE5GofQrv6iSsEKmGrAUVrr9bJMN/jLvvs5wh6Ry1I6tUH4CKbzxEKlzakNh bg9KZHte/IxPw+MsliuPsd/HR25fKtoakV0KoU6dDqKt6y6DWWnjPYpGnesEH88ph5kJ fZpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qdfz2LOk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si22182947plm.290.2018.08.16.09.52.03; Thu, 16 Aug 2018 09:52:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qdfz2LOk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1731201AbeHPTvj (ORCPT + 32 others); Thu, 16 Aug 2018 15:51:39 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37594 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbeHPTvh (ORCPT ); Thu, 16 Aug 2018 15:51:37 -0400 Received: by mail-wr1-f68.google.com with SMTP id u12-v6so4756908wrr.4 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=dtfH7ySeKZ/UZqjoUOjoCWE4qzuncx6g9OCBFCyTylnGQuMGJpMa//BUuK3VTOYsVf f3B0TWrgKiN/FaagnOB1eAIgVziEtCkl5RoERDPHdniPoRx7HchVLo57VVFYQUkcCy5p dZmTx95acQXMAyzq1U8bX904GOELaQ8Y1sfcTuAgMLV1mlJCcsEfdIStHfldi+VxL1dT p8GC0LktD5AsEuCWu2RQRwKwdQMNy++TTQHd+sLY5yos0xBhVRGtphqmxayPFBG0w6mK FgXTu0ETSjcfoNyNfn9i6BJ5HiAZkKR2KJnYpb04koPXAZHR1KhLP/WxKWKO+Uyks6uS DRow== X-Gm-Message-State: APzg51DxyFyYMdsTYzQnyxpDd032vwdfq3Fm3g0q0EGb2hPjwpE2ADBd uIf4jziDlc65zYLykNqzNrUODg== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.16.1 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)