linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Luca Abeni <luca.abeni@santannapisa.it>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <Valentin.Schneider@arm.com>,
	Qais Yousef <Qais.Yousef@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] sched/deadline: Use __sub_running_bw() throughout dl_change_utilization()
Date: Mon, 29 Jul 2019 18:21:55 +0100	[thread overview]
Message-ID: <fc48cf4a-6153-5ead-72cd-76df4b10d6a0@arm.com> (raw)
In-Reply-To: <20190729164755.GM31398@hirez.programming.kicks-ass.net>

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 <dietmar.eggemann@arm.com>
>> ---
>>  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().

  reply	other threads:[~2019-07-29 17:22 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26  8:27 [PATCH 0/5] sched/deadline: Fix double accounting in push_dl_task() & some cleanups Dietmar Eggemann
2019-07-26  8:27 ` [PATCH 1/5] sched/deadline: Fix double accounting of rq/running bw in push_dl_task() Dietmar Eggemann
2019-07-26 10:11   ` luca abeni
2019-07-29  8:59     ` Dietmar Eggemann
2019-07-29 16:10       ` Peter Zijlstra
2019-07-26 13:30   ` luca abeni
2019-07-29  9:00     ` Dietmar Eggemann
2019-07-31 10:32       ` Dietmar Eggemann
2019-07-26  8:27 ` [PATCH 2/5] sched/deadline: Remove unused int flags from __dequeue_task_dl() Dietmar Eggemann
2019-07-29 16:35   ` Peter Zijlstra
2019-07-29 17:12     ` Dietmar Eggemann
2019-07-26  8:27 ` [PATCH 3/5] sched/deadline: Use __sub_running_bw() throughout dl_change_utilization() Dietmar Eggemann
2019-07-29 16:47   ` Peter Zijlstra
2019-07-29 17:21     ` Dietmar Eggemann [this message]
2019-07-26  8:27 ` [PATCH 4/5] sched/deadline: Cleanup on_dl_rq() handling Dietmar Eggemann
2019-07-26  8:37   ` Valentin Schneider
2019-07-26  8:58     ` Qais Yousef
2019-07-26  9:20     ` Juri Lelli
2019-07-26  9:32       ` Valentin Schneider
2019-07-29 16:49   ` Peter Zijlstra
2019-07-30  6:41     ` Juri Lelli
2019-07-30  8:21       ` Peter Zijlstra
2019-07-31 17:32         ` Dietmar Eggemann
2019-07-31 20:20           ` luca abeni
2019-08-01 16:01             ` Dietmar Eggemann
2019-07-26  8:27 ` [PATCH 5/5] sched/deadline: Use return value of SCHED_WARN_ON() in bw accounting Dietmar Eggemann
2019-07-26 10:18   ` luca abeni
2019-07-29 16:54     ` Peter Zijlstra
2019-07-29 16:59       ` Dietmar Eggemann
2019-07-30  8:23         ` Peter Zijlstra
2019-07-30 16:08           ` Dietmar Eggemann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc48cf4a-6153-5ead-72cd-76df4b10d6a0@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=Qais.Yousef@arm.com \
    --cc=Valentin.Schneider@arm.com \
    --cc=bristot@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).