From: Mike Galbraith <efault@gmx.de>
To: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
mingo@kernel.org, LKML <linux-kernel@vger.kernel.org>,
roland@kernel.org, Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
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 11:25:07 +0200 [thread overview]
Message-ID: <1338801907.7356.163.camel@marge.simpson.net> (raw)
In-Reply-To: <4FCC4E3B.4090209@linux.vnet.ibm.com>
On Mon, 2012-06-04 at 11:27 +0530, Prashanth Nageshappa wrote:
> Based on the description in
> http://marc.info/?l=linux-kernel&m=133108682113018&w=2 , I was able to recreate
> a problem where in a SCHED_OTHER thread never gets runtime, even though there is
> one allowed CPU where it can run and make progress.
>
> On a dual socket box (4 cores per socket, 2 threads per core) with following
> config:
> 0 8 1 9 4 12 5 13
> 2 10 3 11 6 14 7 15
> |__________| |__________|
> socket 1 socket 2
>
> If we have following 4 tasks (2 SCHED_FIFO and 2 SCHED_OTHER) started in the
> following order:
> 1> SCHED_FIFO cpu hogging task bound to cpu 1
> 2> SCHED_OTHER cpu hogging task bound to cpus 3 & 9 - running on cpu 3
> sleeps and wakes up after all other tasks are started
> 3> SCHED_FIFO cpu hogging task bound to cpu 3
> 4> SCHED_OTHER cpu hogging task bound to cpu 9
>
> Once all the 4 tasks are started, we observe that 2nd task is starved of CPU
> after waking up. When it wakes up, it wakes up on its prev_cpu (3) where
> a FIFO task is now hogging the cpu. To prevent starvation, 2nd task
> needs to be pulled to cpu 9. However, between cpus 1, 9, cpu1 is the chosen
> cpu that attempts pulling tasks towards its core. When it tries pulling
> 2nd tasks towards its core, it is unable to do so as cpu1 is not in 2nd
> task's cpus_allowed mask. Ideally cpu1 should note that the task can be
> moved to its sibling and trigger that movement.
Isn't this poking the wrong spot?
Making load balancing try to correct a bad situation created by a gone
insane SCHED_FIFO task looks wrong to me. Better would be to make sure
insane RT tasks cannot borrow runtime indefinitely. End result of 100%
SCHED_FIFO is dead box, so whether we have a spot where we could place
poor doomed SCHED_OTHER task seems kinda moot.
Also, seems everybody and his brother thinks their stuff is so critical
that they run stuff SCHED_FIFO/99, which is dainbramaged but seemingly
common practice. To make the system more robust in the face of that
insanity, we _could_ perhaps tick SCHED_FIFO when budget is staying
exceeded, which would allow sane threads at the same prio to get CPU
instead of returning CPU to the criminally insane. Better would be to
just detect elite sociopath, and noisily cancel his Unobtanium CPU Card.
-Mike
next prev parent reply other threads:[~2012-06-04 9:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 5:57 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 [this message]
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
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=1338801907.7356.163.camel@marge.simpson.net \
--to=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome