lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 24 Aug 2006 15:24:59 +1000
From:	Peter Williams <pwil3058@...pond.net.au>
To:	Chris Friesen <cfriesen@...tel.com>
CC:	rparedes@...il.com, linux-kernel@...r.kernel.org
Subject: Re: SMP Affinity and nice

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@...pond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ