Skip to content

Commit

Permalink
sched: Add WAKEUP_PREEMPTION feature flag, on by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ingo Molnar authored and Ingo Molnar committed Oct 16, 2012
1 parent 301a5cb commit 8ed92e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions kernel/sched/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 8ed92e5

Please sign in to comment.