]> bbs.cooldavid.org Git - net-next-2.6.git/commit - kernel/sched.c
[PATCH] sched: improve load balancing pinned tasks
authorNick Piggin <nickpiggin@yahoo.com.au>
Sat, 25 Jun 2005 21:57:07 +0000 (14:57 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 25 Jun 2005 23:24:40 +0000 (16:24 -0700)
commit8102679447da7fcbcb5226ee0207c3a034bc6d5f
treebb1717150a94a02a44c3bafc9bf8969ef6045f89
parente0f364f4069f76a3613a797c388832822d179076
[PATCH] sched: improve load balancing pinned tasks

John Hawkes explained the problem best:

A large number of processes that are pinned to a single CPU results
in every other CPU's load_balance() seeing this overloaded CPU as
"busiest", yet move_tasks() never finds a task to pull-migrate.  This
condition occurs during module unload, but can also occur as a
denial-of-service using sys_sched_setaffinity().  Several hundred
CPUs performing this fruitless load_balance() will livelock on the
busiest CPU's runqueue lock.  A smaller number of CPUs will livelock
if the pinned task count gets high.

Expanding slightly on John's patch, this one attempts to work out whether the
balancing failure has been due to too many tasks pinned on the runqueue.  This
allows it to be basically invisible to the regular blancing paths (ie.  when
there are no pinned tasks).  We can use this extra knowledge to shut down the
balancing faster, and ensure the migration threads don't start running which
is another problem observed in the wild.

Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/sched.c