All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>,
	Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>,
	mingo@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	roland@kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] sched: balance_cpu to consider other cpus in its group as target of (pinned) task migration
Date: Mon, 04 Jun 2012 17:21:11 +0200	[thread overview]
Message-ID: <1338823271.28282.75.camel@twins> (raw)
In-Reply-To: <20120604150040.GD25126@linux.vnet.ibm.com>

On Mon, 2012-06-04 at 20:30 +0530, Srivatsa Vaddagiri wrote:
> * Mike Galbraith <efault@gmx.de> [2012-06-04 16:41:35]:
> 
> > But high priority SCHED_OTHER tasks do not hog the CPU, they get their
> > fair share as defined by the user.
> 
> Consider this case. System with 2 cores (each with 2 thread) and 3
> cgroups :
> 
> 	A (1024) -> has 2 tasks (A0, A1)
> 	B (2048) -> has 2 tasks (B0, B1)
> 	C (1024) -> has 1 tasks (C0 - pinned to CPUs 1,2)
> 
> (B0, B1) collectively are eligible to consume 2 full cpus worth of
> bandwidth, (A0, A1) together are eligible to consume 1 full-cpu
> worth of bandwidth and finally C0 is eligible to get 1 full-cpu worth of
> bandwidth. 

The much simpler way to say that is: 5 tasks, two of 512, 3 of 1024.

> Currently C0 is sleeping as a result of which tasks could be spread as:
> 
> 	CPU0 -> A0
> 	CPU1 -> A1
> 
> 	CPU2 -> B0
> 	CPU3 -> B1
> 
> Now C0 wakes up and lands on CPU2 (which was its prev_cpu).
> 
> 	CPU0 -> A0
> 	CPU1 -> A1
> 
> 	CPU2 -> B0, C0
> 	CPU3 -> B1

That's 512, 512, 2048, 1024.

> Ideally CPU1 needs to pull it C0 to itself (while A1 moves to CPU0). Do
> you agree to that? I doubt that happens because of how CPU0 does load
> balance on behalf of itself and CPU1 (and thus fails to pull C0 to its
> core).

Right, 0 can't pull C0 because of cpus_allowed, it can however pull B0,
resulting in: {A0, B0}:1536, {A1}:512, {C0}:1024, {B1}:1024, the next
balance pass of 1 will then pull A0, resulting in: {B0}:1024, {A0,
A1}:1024, {C0}:1024, {B1}:1024

And all is well again.

That is not to say you couldn't contrive a scenario where it would be
needed.. 

  reply	other threads:[~2012-06-04 15:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04  5:57 [PATCH] sched: balance_cpu to consider other cpus in its group as target of (pinned) task migration Prashanth Nageshappa
2012-06-04  9:00 ` Peter Zijlstra
2012-06-04 11:41   ` Srivatsa Vaddagiri
2012-06-04 11:49     ` Peter Zijlstra
2012-06-04 12:27       ` Srivatsa Vaddagiri
2012-06-04 11:51     ` Peter Zijlstra
2012-06-04  9:25 ` Mike Galbraith
2012-06-04 11:53   ` Peter Zijlstra
2012-06-04 12:47     ` Mike Galbraith
2012-06-04 13:07       ` Srivatsa Vaddagiri
2012-06-04 14:30         ` Mike Galbraith
2012-06-04 14:38           ` Srivatsa Vaddagiri
2012-06-04 14:41             ` Mike Galbraith
2012-06-04 15:00               ` Srivatsa Vaddagiri
2012-06-04 15:21                 ` Peter Zijlstra [this message]
2012-06-04 15:25                   ` Srivatsa Vaddagiri
2012-06-04 15:33                     ` Peter Zijlstra
2012-06-04 15:46                       ` Srivatsa Vaddagiri
2012-06-04 16:56                       ` Mike Galbraith
2012-06-04 17:37                         ` Srivatsa Vaddagiri

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=1338823271.28282.75.camel@twins \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=prashanth@linux.vnet.ibm.com \
    --cc=roland@kernel.org \
    --cc=vatsa@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.