>From ccd1e7d300c1f939da745e1c0d50d13fc3ccec7b Mon Sep 17 00:00:00 2001 From: Stephan Baerwolf Date: Wed, 20 Jul 2011 14:37:56 +0200 Subject: [PATCH 1/3] sched: check WAKEUP_PREEMPT feature before preemting anything The function "check_preempt_wakeup" (kernel/sched_fair.c:1885) will preempt idle-task (for non-idle task), even if WAKEUP_PREEMPT is not featured (because of a too late checking the feature). This patches moves the checking of WAKEUP_PREEMT in front of idle-preemtion. Signed-off-by: Stephan Baerwolf --- kernel/sched_fair.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 433491c..e092e72 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -1905,6 +1905,9 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ if (test_tsk_need_resched(curr)) return; + if (!sched_feat(WAKEUP_PREEMPT)) + return; + /* Idle tasks are by definition preempted by non-idle tasks. */ if (unlikely(curr->policy == SCHED_IDLE) && likely(p->policy != SCHED_IDLE)) @@ -1918,9 +1921,6 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; - if (!sched_feat(WAKEUP_PREEMPT)) - return; - update_curr(cfs_rq); find_matching_se(&se, &pse); BUG_ON(!pse); -- 1.7.3.4