From: Peter Williams <pwil3058@bigpond.net.au>
To: Chris Friesen <cfriesen@nortel.com>
Cc: rparedes@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: SMP Affinity and nice
Date: Thu, 24 Aug 2006 15:24:59 +1000 [thread overview]
Message-ID: <44ED382B.9080601@bigpond.net.au> (raw)
In-Reply-To: <44ECC09A.7090909@nortel.com>
Chris Friesen wrote:
> Rich Paredes wrote:
>
>> So since cpumax5 has a lower nice value and thus a higher priority (25 in
>> this case), shouldn't it be given it's own cpu. If I give cpumax5 a
>> nice
>> value of -20, it does start using it's own cpu.
>>
>> My explanation would be that since the scheduler tries to limit cpu
>> affinity, the nice value of 0 isn't enough to get the scheduler to move
>> this process to another processors run queue. I could be totally wrong
>> here though.
>
> I think you are correct. The load balancer doesn't think that this is
> enough of an imbalance to go through the effort of swapping two
> processes around.
The kernel in use (2.6.5) doesn't take nice into account during load
balancing and just allocates the 5 tasks among the 4 CPUs in a way that
tries to give each CPU the same number of tasks. It also tries not to
move tasks around too much so when it has found a solution that
satisfies that criterion it leaves the tasks there.
5 tasks among 4 CPUs means 1 task each for 3 of the CPUs and 2 tasks for
the other CPU. As nice isn't taken into account it is purely down to
chance whether or not the high priority task ends up being one of those
that gets a CPU to itself or has to share with another task. Some
elementary probability theory should enable the probability of a "good"
outcome (i.e. the high priority task not having to share) to be calculated.
This is an example of the type of situation that the smpnice patches
were designed to handle. They take nice into account and should ensure
that the high priority does get a CPU to itself in this scenario. They
are scheduled for release in the 2.6.18 kernel.
Peter
--
Peter Williams pwil3058@bigpond.net.au
"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce
prev parent reply other threads:[~2006-08-24 5:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-23 15:24 SMP Affinity and nice Rich Paredes
2006-08-23 15:36 ` Jan Engelhardt
2006-08-24 1:30 ` Peter Williams
[not found] ` <3bfa83ed0608231920h5d9ef2bbxee71badedb38e3f7@mail.gmail.com>
2006-08-24 4:39 ` Peter Williams
2006-08-23 20:54 ` Chris Friesen
2006-08-24 5:24 ` Peter Williams [this message]
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=44ED382B.9080601@bigpond.net.au \
--to=pwil3058@bigpond.net.au \
--cc=cfriesen@nortel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rparedes@gmail.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