linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: Darren Hart <darren@dvhart.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	"Stultz, John" <johnstul@us.ibm.com>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: RT task scheduling
Date: Fri, 07 Apr 2006 09:06:27 +1000	[thread overview]
Message-ID: <44359EF3.9070708@bigpond.net.au> (raw)
In-Reply-To: <20060406073753.GA18349@elte.hu>

Ingo Molnar wrote:
> * Darren Hart <darren@dvhart.com> wrote:
> 
>> My last mail specifically addresses preempt-rt, but I'd like to know 
>> people's thoughts regarding this issue in the mainline kernel.  Please 
>> see my previous post "realtime-preempt scheduling - rt_overload 
>> behavior" for a testcase that produces unpredictable scheduling 
>> results.
> 
> the rt_overload feature i intend to push upstream-wards too, i just 
> didnt separate it out of -rt yet.
> 
> "RT overload scheduling" is a totally orthogonal mechanism to the SMP 
> load-balancer (and this includes smpnice too) that is more or less 
> equivalent to having a 'global runqueue' for real-time tasks, without 
> the SMP overhead associated with that. If there is no "RT overload" [the 
> common case even on Linux systems that _do_ make use of RT tasks 
> occasionally], the new mechanism is totally inactive and there's no 
> overhead. But once there are more RT tasks than CPUs, the scheduler will 
> do "global" decisions for what RT tasks to run on which CPU. To put even 
> less overhead on the mainstream kernel, i plan to introduce a new 
> SCHED_FIFO_GLOBAL scheduling policy to trigger this behavior. [it doesnt 
> make much sense to extend SCHED_RR in that direction.]
> 
> my gut feeling is that it would be wrong to integrate this feature into 
> smpnice: SCHED_FIFO is about determinism, and smpnice is a fundamentally 
> statistical approach. Also, smpnice doesnt have to try as hard to pick 
> the right task as rt_overload does, so there would be constant 
> 'friction' between "overhead" optimizations (dont be over-eager) and 
> "latency" optimizations (dont be _under_-eager). So i'm quite sure we 
> want this feature separate. [nevertheless i'd happy to be proven wrong 
> via some good and working smpnice based solution]

I was thinking about this over night and came to similar conclusions. 
I.e. for RT tasks it's really a problem of selecting the right CPU at 
wake up time rather than a general load balancing problem.  The solution 
that I thought of was different (though) and involved modifying 
wake_idle() so that when the woken task was high priority as well as 
looking for idle CPUs it looked for the one with the lowest priority 
current task and if it couldn't find an idle CPU it returned the one 
with the lowest priority current task.  The aim was to maximize the 
probability that the newly woken task went straight onto a CPU (either 
by finding an idle one or preemption).

Although aimed at this specific problem, this solution would also help 
smpnice to attain equal "average load per task" values for groups/queues 
which I think is a desirable secondary aim to equatable distribution of 
weighted load.  If both of these aims are met I think a natural outcome 
would be that the highest priority tasks are well distributed among the 
CPUs (but, as you imply, this would be a statistical trend rather than 
an deterministic).

In summary, I think that smpnice can be modified in ways that will help 
with this problem but if you need determinism then special measures are 
probably necessary.

Peter
---
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

  parent reply	other threads:[~2006-04-06 23:06 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-06  3:25 RT task scheduling Darren Hart
2006-04-06  4:19 ` Peter Williams
2006-04-06 17:24   ` Darren Hart
2006-04-06 23:02     ` Peter Williams
2006-04-06  7:37 ` Ingo Molnar
2006-04-06 14:55   ` Darren Hart
2006-04-06 18:16   ` Darren Hart
2006-04-06 22:35     ` Darren Hart
2006-04-07 22:58       ` Vernon Mauery
2006-04-06 23:06   ` Peter Williams [this message]
2006-04-07  3:07   ` Bill Huey
2006-04-07  7:11     ` Ingo Molnar
2006-04-07  8:39       ` Bill Huey
2006-04-07  9:11         ` Bill Huey
2006-04-07  9:19         ` Ingo Molnar
2006-04-07 10:39           ` Bill Huey
2006-04-07 10:51             ` Ingo Molnar
2006-04-07 11:14               ` Bill Huey
2006-04-07 11:29                 ` Ingo Molnar
2006-04-07 22:18                   ` Bill Huey
2006-04-07 14:56             ` Darren Hart
2006-04-07 21:06               ` Bill Huey
2006-04-07 22:37                 ` Darren Hart
2006-04-07 23:36                   ` Bill Huey
2006-04-08  3:01                     ` Steven Rostedt
2006-04-08  4:28                       ` Vernon Mauery
2006-04-08  4:45                         ` Steven Rostedt
2006-04-08  7:16                 ` Ingo Molnar
2006-04-08  7:25                   ` Ingo Molnar
2006-04-08  7:54                     ` Bill Huey
2006-04-08  8:03                       ` Ingo Molnar
2006-04-08 10:02                         ` Bill Huey
2006-04-08  0:11   ` Peter Williams
2006-04-07  9:23 ` Bill Huey
2006-04-09 13:16 ` Ingo Molnar
2006-04-09 17:25   ` Darren Hart
2006-04-09 18:31     ` Ingo Molnar

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=44359EF3.9070708@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=darren@dvhart.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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).