public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Snook <csnook@redhat.com>
To: Chris Friesen <cfriesen@nortel.com>
Cc: Tong Li <tong.n.li@intel.com>,
	mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [RFC] scheduler: improve SMP fairness in CFS
Date: Tue, 24 Jul 2007 16:39:47 -0400	[thread overview]
Message-ID: <46A66393.5000705@redhat.com> (raw)
In-Reply-To: <46A6576A.9020506@nortel.com>

Chris Friesen wrote:
> Chris Snook wrote:
> 
>> Concerns aside, I agree that fairness is important, and I'd really 
>> like to see a test case that demonstrates the problem.
> 
> One place that might be useful is the case of fairness between resource 
> groups, where the load balancer needs to consider each group separately.

You mean like the CFS group scheduler patches?  I don't see how this patch is 
related to that, besides working on top of it.

> Now it may be the case that trying to keep the load of each class within 
> X% of the other cpus is sufficient, but it's not trivial.

I agree.  My suggestion is that we try being fair from the bottom-up, rather 
than top-down.  If most of the rebalancing is local, we can minimize expensive 
locking and cross-node migrations, and scale very nicely on large NUMA boxes.

> Consider the case where you have a resource group that is allocated 50% 
> of each cpu in a dual cpu system, and only have a single task in that 
> group.  This means that in order to make use of the full group 
> allocation, that task needs to be load-balanced to the other cpu as soon 
> as it gets scheduled out.  Most load-balancers can't handle that kind of 
> granularity, but I have guys in our engineering team that would really 
> like this level of performance.

Divining the intentions of the administrator is an AI-complete problem and we're 
not going to try to solve that in the kernel.  An intelligent administrator 
could also allocate 50% of each CPU to a resource group containing all the 
*other* processes.  Then, when the other processes are scheduled out, your 
single task will run on whichever CPU is idle.  This will very quickly 
equilibrate to the scheduling ping-pong you seem to want.  The scheduler 
deliberately avoids this kind of migration by default because it hurts cache and 
TLB performance, so if you want to override this very sane default behavior, 
you're going to have to explicitly configure it yourself.

> We currently use CKRM on an SMP machine, but the only way we can get 
> away with it is because our main app is affined to one cpu and just 
> about everything else is affined to the other.

If you're not explicitly allocating resources, you're just low-latency, not 
truly realtime.  Realtime requires guaranteed resources, so messing with 
affinities is a necessary evil.

> We have another SMP box that would benefit from group scheduling, but we 
> can't use it because the load balancer is not nearly good enough.

Which scheduler?  Have you tried the CFS group scheduler patches?

	-- Chris

  reply	other threads:[~2007-07-24 20:40 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23 18:38 [RFC] scheduler: improve SMP fairness in CFS Tong Li
2007-07-23 20:00 ` Andi Kleen
2007-07-23 21:10   ` Li, Tong N
2007-07-23 21:25     ` Chris Friesen
2007-07-24  9:43       ` Andi Kleen
2007-07-23 23:40 ` Chris Snook
2007-07-24  8:07   ` Chris Snook
2007-07-24 17:11     ` Li, Tong N
2007-07-24 17:07   ` Tong Li
2007-07-24 18:08     ` Chris Snook
2007-07-24 19:47       ` Chris Friesen
2007-07-24 20:39         ` Chris Snook [this message]
2007-07-24 20:58           ` Li, Tong N
2007-07-24 21:09             ` Chris Snook
2007-07-24 21:23               ` Chris Friesen
2007-07-24 21:45                 ` Chris Snook
2007-07-24 23:33                   ` Chris Friesen
2007-07-24 21:06           ` Bill Huey
2007-07-24 21:22             ` Chris Snook
2007-07-24 23:14               ` Bill Huey
2007-07-24 21:12           ` Chris Friesen
2007-07-25 11:01 ` Ingo Molnar
2007-07-25 12:03   ` Ingo Molnar
2007-07-25 17:23     ` Tong Li
2007-07-25 19:24       ` Ingo Molnar
2007-07-25 20:38         ` Chris Friesen
2007-07-25 20:55           ` Chris Snook
2007-07-25 21:15             ` Li, Tong N
2007-07-25 22:24               ` Chris Snook
2007-07-26 19:00         ` Tong Li
2007-07-26 21:31           ` Ingo Molnar
2007-07-26 22:00             ` Li, Tong N
2007-07-27  1:34               ` Tong Li
2007-07-27 17:16                 ` Chris Snook
2007-07-27 19:03                   ` Tong Li
2007-07-27 22:20                     ` Bill Huey
2007-07-27 23:36                     ` Chris Snook
2007-07-28  0:54                       ` Bill Huey
2007-07-28  2:59                         ` Chris Snook
2007-07-28 19:38                           ` Tong Li
2007-07-29  2:40                             ` Chris Snook
2007-07-28 19:23                       ` Tong Li
2007-07-29  3:01                         ` Chris Snook
2007-07-25 18:20     ` Li, Tong N
2007-07-25 19:18       ` 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=46A66393.5000705@redhat.com \
    --to=csnook@redhat.com \
    --cc=cfriesen@nortel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tong.n.li@intel.com \
    /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