linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/rt: Don't active rt throtting when no running cfs task
@ 2020-06-16 12:37 Lichao Liu
  2020-06-16 13:50 ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Lichao Liu @ 2020-06-16 12:37 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, linux-kernel, Lichao Liu

Active rt throtting will dequeue rt_rq from rq at least 50ms,
When there is no running cfs task, do we still active it?

Signed-off-by: Lichao Liu <liulichao@loongson.cn>
---
 kernel/sched/rt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index df11d88c9895..d6524347cea0 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -961,12 +961,13 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
 
 	if (rt_rq->rt_time > runtime) {
 		struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);
+		struct rq *rq = rq_of_rt_rq(rt_rq);
 
 		/*
 		 * Don't actually throttle groups that have no runtime assigned
 		 * but accrue some time due to boosting.
 		 */
-		if (likely(rt_b->rt_runtime)) {
+		if (likely(rt_b->rt_runtime) && rq->cfs.nr_running > 0) {
 			rt_rq->rt_throttled = 1;
 			printk_deferred_once("sched: RT throttling activated\n");
 		} else {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/rt: Don't active rt throtting when no running cfs task
  2020-06-16 12:37 [PATCH] sched/rt: Don't active rt throtting when no running cfs task Lichao Liu
@ 2020-06-16 13:50 ` Steven Rostedt
  2020-06-16 14:01   ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2020-06-16 13:50 UTC (permalink / raw)
  To: Lichao Liu
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	bsegall, mgorman, linux-kernel

On Tue, 16 Jun 2020 20:37:29 +0800
Lichao Liu <liulichao@loongson.cn> wrote:

> Active rt throtting will dequeue rt_rq from rq at least 50ms,
> When there is no running cfs task, do we still active it?
> 

This is something I would like to have.

Peter, what's your thought on this?

-- Steve

> Signed-off-by: Lichao Liu <liulichao@loongson.cn>
> ---
>  kernel/sched/rt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index df11d88c9895..d6524347cea0 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -961,12 +961,13 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
>  
>  	if (rt_rq->rt_time > runtime) {
>  		struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);
> +		struct rq *rq = rq_of_rt_rq(rt_rq);
>  
>  		/*
>  		 * Don't actually throttle groups that have no runtime assigned
>  		 * but accrue some time due to boosting.
>  		 */
> -		if (likely(rt_b->rt_runtime)) {
> +		if (likely(rt_b->rt_runtime) && rq->cfs.nr_running > 0) {
>  			rt_rq->rt_throttled = 1;
>  			printk_deferred_once("sched: RT throttling activated\n");
>  		} else {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/rt: Don't active rt throtting when no running cfs task
  2020-06-16 13:50 ` Steven Rostedt
@ 2020-06-16 14:01   ` Peter Zijlstra
  2020-06-16 14:59     ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2020-06-16 14:01 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Lichao Liu, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
	bsegall, mgorman, linux-kernel

On Tue, Jun 16, 2020 at 09:50:27AM -0400, Steven Rostedt wrote:
> On Tue, 16 Jun 2020 20:37:29 +0800
> Lichao Liu <liulichao@loongson.cn> wrote:
> 
> > Active rt throtting will dequeue rt_rq from rq at least 50ms,
> > When there is no running cfs task, do we still active it?
> > 
> 
> This is something I would like to have.
> 
> Peter, what's your thought on this?

I'd love to just delete all of this.. that said, I'm not sure this
change makes sense, because it doesn't deal sanely with the case where
the task will appear right after we did this.

The right thing to do is that fair deadline server thing.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/rt: Don't active rt throtting when no running cfs task
  2020-06-16 14:01   ` Peter Zijlstra
@ 2020-06-16 14:59     ` Steven Rostedt
  2020-06-16 17:07       ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2020-06-16 14:59 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Lichao Liu, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
	bsegall, mgorman, linux-kernel

On Tue, 16 Jun 2020 16:01:58 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, Jun 16, 2020 at 09:50:27AM -0400, Steven Rostedt wrote:
> > On Tue, 16 Jun 2020 20:37:29 +0800
> > Lichao Liu <liulichao@loongson.cn> wrote:
> >   
> > > Active rt throtting will dequeue rt_rq from rq at least 50ms,
> > > When there is no running cfs task, do we still active it?
> > >   
> > 
> > This is something I would like to have.
> > 
> > Peter, what's your thought on this?  
> 
> I'd love to just delete all of this.. that said, I'm not sure this
> change makes sense, because it doesn't deal sanely with the case where
> the task will appear right after we did this.

I haven't looked closely at the surrounding code, but wouldn't it get
throttled in the next period? Do we care if a task has to wait a bit
longer?

> 
> The right thing to do is that fair deadline server thing.

But we've been saying that for years now.

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/rt: Don't active rt throtting when no running cfs task
  2020-06-16 14:59     ` Steven Rostedt
@ 2020-06-16 17:07       ` Peter Zijlstra
  2020-06-16 18:33         ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Zijlstra @ 2020-06-16 17:07 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Lichao Liu, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
	bsegall, mgorman, linux-kernel

On Tue, Jun 16, 2020 at 10:59:00AM -0400, Steven Rostedt wrote:
> On Tue, 16 Jun 2020 16:01:58 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > On Tue, Jun 16, 2020 at 09:50:27AM -0400, Steven Rostedt wrote:
> > > On Tue, 16 Jun 2020 20:37:29 +0800
> > > Lichao Liu <liulichao@loongson.cn> wrote:
> > >   
> > > > Active rt throtting will dequeue rt_rq from rq at least 50ms,
> > > > When there is no running cfs task, do we still active it?
> > > >   
> > > 
> > > This is something I would like to have.
> > > 
> > > Peter, what's your thought on this?  
> > 
> > I'd love to just delete all of this.. that said, I'm not sure this
> > change makes sense, because it doesn't deal sanely with the case where
> > the task will appear right after we did this.
> 
> I haven't looked closely at the surrounding code, but wouldn't it get
> throttled in the next period? Do we care if a task has to wait a bit
> longer?

Either way around, who cares?

> > The right thing to do is that fair deadline server thing.
> 
> But we've been saying that for years now.

Hey, I even coded most of it, but clearly nobody cares about this enough
to finish it ... 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sched/rt: Don't active rt throtting when no running cfs task
  2020-06-16 17:07       ` Peter Zijlstra
@ 2020-06-16 18:33         ` Steven Rostedt
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2020-06-16 18:33 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Lichao Liu, mingo, juri.lelli, vincent.guittot, dietmar.eggemann,
	bsegall, mgorman, linux-kernel

On Tue, 16 Jun 2020 19:07:11 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> > But we've been saying that for years now.  
> 
> Hey, I even coded most of it, but clearly nobody cares about this enough
> to finish it ... 

Or nobody who knows enough (and has enough time) to do so cares ;-)

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-16 18:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 12:37 [PATCH] sched/rt: Don't active rt throtting when no running cfs task Lichao Liu
2020-06-16 13:50 ` Steven Rostedt
2020-06-16 14:01   ` Peter Zijlstra
2020-06-16 14:59     ` Steven Rostedt
2020-06-16 17:07       ` Peter Zijlstra
2020-06-16 18:33         ` Steven Rostedt

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).