From: Chen, Kenneth W Date: Tue, 27 Jun 2006 09:54:28 +0000 (-0700) Subject: [PATCH] sched: fix smt nice lock contention and optimization X-Git-Tag: v2.6.18-rc1~516 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c96d145e71c5c84601322d85748512e09d7b325f;p=pandora-kernel.git [PATCH] sched: fix smt nice lock contention and optimization Initial report and lock contention fix from Chris Mason: Recent benchmarks showed some performance regressions between 2.6.16 and 2.6.5. We tracked down one of the regressions to lock contention in schedule heavy workloads (~70,000 context switches per second) kernel/sched.c:dependent_sleeper() was responsible for most of the lock contention, hammering on the run queue locks. The patch below is more of a discussion point than a suggested fix (although it does reduce lock contention significantly). The dependent_sleeper code looks very expensive to me, especially for using a spinlock to bounce control between two different siblings in the same cpu. It is further optimized: * perform dependent_sleeper check after next task is determined * convert wake_sleeping_dependent to use trylock * skip smt runqueue check if trylock fails * optimize double_rq_lock now that smt nice is converted to trylock * early exit in searching first SD_SHARE_CPUPOWER domain * speedup fast path of dependent_sleeper [akpm@osdl.org: cleanup] Signed-off-by: Ken Chen Acked-by: Ingo Molnar Acked-by: Con Kolivas Signed-off-by: Nick Piggin Acked-by: Chris Mason Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed