Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3913242ybi; Mon, 29 Jul 2019 15:12:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3iQ4Mx42ec01nBtx1daOAvQB9KYLOERFpROBICFBJ6nVTnowJuvudRk++JE2y91voZeB4 X-Received: by 2002:a17:90a:3724:: with SMTP id u33mr112705245pjb.19.1564438340629; Mon, 29 Jul 2019 15:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564438340; cv=none; d=google.com; s=arc-20160816; b=xbSxfqXbB/HcPrTacFGcYDMpk6l5a/avxiKKdsXh0cKO0efWu2j13NVevdf4l2GZ5O 0G64x75nAnCYKv/bFtr9UHpB0rORp8zVxn1XIAhuuEEeYCgkadLPcOE4jYkt43UZIl/j SiAUMt3ZoP2UMc1pvpscEWPwE7cdpqpd0k4Tn7JceMIzrC3C/QWh0g2YAt+kC7CaJhAA D0W9jMXGq8h7tlk6HJRm/x5DZMAJnPb6r1VpoLi01AbQ6lD7j5l0UJnO3nAZdBTLHN4/ RkgXflTUqwgpRx9yYljcyskzLcj6XfJTUZ41Ir1Veawfm3IovhHtwFwEkf5qrZoHSSHB xf4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=N7t1aTxA3oWkCSXHk0vJk7MKBXUEDx1TQJqrpeVNeSM=; b=K8hYX+Va9UrKtl06BK72OnG48dDXZOXs2UhzL0hcYXutqtafscFnFslpa5kd0Ik3ww f2Vw+bOjy0JuFtLbRX5FqyHsmCN6j5UnOx9IxB31yjnJ+D3RwrOdeTGhocRV8F03eziU JXb+hwu45LorpSr/Q8NhgjGNFoFpULcBl1fHZQp6Sbtnb5RKWnS+jJ/OKAxghpwvPUjH RIpv8LGJXJmdS03yNTKj4Z0fsk5t66C3Mnyl6I577Y1046jbPg3AfG+mDordZGrCriE0 UTD17uKK1N3i0LmfdL4h1ophqW/sqv1i5kqqLFBvcCNckPl9CRv7dTAmw4FEcPcbZreI iTOg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si28098903pgt.258.2019.07.29.15.12.05; Mon, 29 Jul 2019 15:12:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbfG2RV7 (ORCPT + 99 others); Mon, 29 Jul 2019 13:21:59 -0400 Received: from foss.arm.com ([217.140.110.172]:48318 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfG2RV6 (ORCPT ); Mon, 29 Jul 2019 13:21:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F15F0337; Mon, 29 Jul 2019 10:21:57 -0700 (PDT) Received: from [10.1.32.39] (unknown [10.1.32.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E05C93F694; Mon, 29 Jul 2019 10:21:56 -0700 (PDT) Subject: Re: [PATCH 3/5] sched/deadline: Use __sub_running_bw() throughout dl_change_utilization() To: Peter Zijlstra Cc: Ingo Molnar , Juri Lelli , Luca Abeni , Daniel Bristot de Oliveira , Valentin Schneider , Qais Yousef , linux-kernel@vger.kernel.org References: <20190726082756.5525-1-dietmar.eggemann@arm.com> <20190726082756.5525-4-dietmar.eggemann@arm.com> <20190729164755.GM31398@hirez.programming.kicks-ass.net> From: Dietmar Eggemann Message-ID: Date: Mon, 29 Jul 2019 18:21:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190729164755.GM31398@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/19 5:47 PM, Peter Zijlstra wrote: > On Fri, Jul 26, 2019 at 09:27:54AM +0100, Dietmar Eggemann wrote: >> dl_change_utilization() has a BUG_ON() to check that no schedutil >> kthread (sugov) is entering this function. So instead of calling >> sub_running_bw() which checks for the special entity related to a >> sugov thread, call the underlying function __sub_running_bw(). >> >> Signed-off-by: Dietmar Eggemann >> --- >> kernel/sched/deadline.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c >> index 99d4c24a8637..1fa005f79307 100644 >> --- a/kernel/sched/deadline.c >> +++ b/kernel/sched/deadline.c >> @@ -164,7 +164,7 @@ void dl_change_utilization(struct task_struct *p, u64 new_bw) >> >> rq = task_rq(p); >> if (p->dl.dl_non_contending) { >> - sub_running_bw(&p->dl, &rq->dl); >> + __sub_running_bw(p->dl.dl_bw, &rq->dl); >> p->dl.dl_non_contending = 0; >> /* >> * If the timer handler is currently running and the > > I'm confused; the only called of dl_change_utilization() is > sched_dl_overflow(), and that already checks FLAG_SUGOV and exits before > calling. That's right. There is even a BUG_ON(p->dl.flags & SCHED_FLAG_SUGOV) at the beginning of dl_change_utilization(). > So how can this matter? We save the 'if (!dl_entity_is_special(dl_se))' from sub_running_bw() when we call __sub_running_bw() since we know it can't be a special task. Later in dl_change_utilization() we already use the inner bw accounting functions __sub_rq_bw() and __add_rq_bw().