]> bbs.cooldavid.org Git - net-next-2.6.git/commit
Use num_possible_cpus() instead of NR_CPUS for timer distribution
authorjohn stultz <johnstul@us.ibm.com>
Wed, 17 Oct 2007 06:27:18 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:53 +0000 (08:42 -0700)
commitb2d9323d139f5c384fa1ef1d74773b4db1c09b3d
treead2705044b5b781aeb1a119d9c8548a044c7e21f
parent3075d9da0b4ccc88959db30de80ebd11d2dde175
Use num_possible_cpus() instead of NR_CPUS for timer distribution

To avoid lock contention, we distribute the sched_timer calls across the
cpus so they do not trigger at the same instant.  However, I used NR_CPUS,
which can cause needless grouping on small smp systems depending on your
kernel config.  This patch converts to using num_possible_cpus() so we
spread it as evenly as possible on every machine.

Briefly tested w/ NR_CPUS=255 and verified reduced contention.

Signed-off-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/time/tick-sched.c