From 571f6d2fb0b1c04798df783db2ba85e96bcce43d Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sun, 10 Dec 2006 02:20:13 -0800 Subject: [PATCH] [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 --- kernel/sched.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sched.c b/kernel/sched.c index f04add905bdf..fdd26fffaa20 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 -- 2.30.2