Skip to content

Commit

Permalink
[PATCH] sched: avoid taking rq lock in wake_priority_sleeper
Browse files Browse the repository at this point in the history
Avoid taking the request queue lock in wake_priority_sleeper if there are no
running processes.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Peter Williams <pwil3058@bigpond.net.au>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Dec 10, 2006
1 parent ac7d550 commit 571f6d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 571f6d2

Please sign in to comment.