Skip to content

Commit 062d3f9

Browse files
ickleIngo Molnar
authored andcommitted
sched: Warn if garbage is passed to default_wake_function()
Since the default_wake_function() passes its flags onto try_to_wake_up(), warn if those flags collide with internal values. Given that the supplied flags are garbage, no repair can be done but at least alert the user to the damage they are causing. In the belief that these errors should be picked up during testing, the warning is only compiled in under CONFIG_SCHED_DEBUG. Signed-off-by: Chris Wilson <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d136122 commit 062d3f9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4485,6 +4485,7 @@ asmlinkage __visible void __sched preempt_schedule_irq(void)
44854485
int default_wake_function(wait_queue_entry_t *curr, unsigned mode, int wake_flags,
44864486
void *key)
44874487
{
4488+
WARN_ON_ONCE(IS_ENABLED(CONFIG_SCHED_DEBUG) && wake_flags & ~WF_SYNC);
44884489
return try_to_wake_up(curr->private, mode, wake_flags);
44894490
}
44904491
EXPORT_SYMBOL(default_wake_function);

0 commit comments

Comments
 (0)