sched: Add WAKEUP_PREEMPTION feature flag, on by default
authorIngo Molnar <mingo@elte.hu>
Sun, 14 Oct 2012 12:28:50 +0000 (14:28 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 16 Oct 2012 08:05:27 +0000 (10:05 +0200)
As per the recent discussion with Mike and Linus, make it easier to
test with/without this feature. No change in default behavior.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-izoxq4haeg4mTognnDbwcevt@git.kernel.org
kernel/sched/fair.c
kernel/sched/features.h

index 6b800a14b9903c81d7bc9b2176b03e750c951108..f936552b3db1a400db1f2a01c5fe47329aed8b96 100644 (file)
@@ -2907,7 +2907,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
         * Batch and idle tasks do not preempt non-idle tasks (their preemption
         * is driven by the tick):
         */
-       if (unlikely(p->policy != SCHED_NORMAL))
+       if (unlikely(p->policy != SCHED_NORMAL) || !sched_feat(WAKEUP_PREEMPTION))
                return;
 
        find_matching_se(&se, &pse);
index eebefcad7027a0587977fb1cecaeb0d13cac79a0..e68e69ab917dcc244577504027e1b357230c55fe 100644 (file)
@@ -31,6 +31,11 @@ SCHED_FEAT(LAST_BUDDY, true)
  */
 SCHED_FEAT(CACHE_HOT_BUDDY, true)
 
+/*
+ * Allow wakeup-time preemption of the current task:
+ */
+SCHED_FEAT(WAKEUP_PREEMPTION, true)
+
 /*
  * Use arch dependent cpu power functions
  */