From: Christoph Lameter Date: Sun, 10 Dec 2006 10:20:13 +0000 (-0800) Subject: [PATCH] sched: avoid taking rq lock in wake_priority_sleeper X-Git-Tag: v2.6.20-rc1~145^2~46 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=571f6d2fb0b1c04798df783db2ba85e96bcce43d;p=linux-2.6 [PATCH] sched: avoid taking rq lock in wake_priority_sleeper Avoid taking the request queue lock in wake_priority_sleeper if there are no running processes. Signed-off-by: Christoph Lameter Cc: Peter Williams Cc: Nick Piggin Cc: Christoph Lameter Cc: "Siddha, Suresh B" Cc: "Chen, Kenneth W" Cc: KAMEZAWA Hiroyuki Acked-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sched.c b/kernel/sched.c index f04add905b..fdd26fffaa 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2915,6 +2915,9 @@ static inline int wake_priority_sleeper(struct rq *rq) int ret = 0; #ifdef CONFIG_SCHED_SMT + if (!rq->nr_running) + return 0; + spin_lock(&rq->lock); /* * If an SMT sibling task has been put to sleep for priority