Skip to content

Commit

Permalink
sched/core: Always panic when scheduling in atomic context
Browse files Browse the repository at this point in the history
Scheduling in atomic context is indicative of a serious problem that,
although may not be immediately lethal, can lead to strange issues and
eventually a panic. We should therefore panic the first time it's
detected.

Signed-off-by: Sultan Alsawaf <[email protected]>
Signed-off-by: atndko <[email protected]>
  • Loading branch information
kerneltoast authored and Official-Ayrton990 committed Jun 6, 2022
1 parent 47f546f commit 2c5530c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4191,14 +4191,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
print_ip_sym(preempt_disable_ip);
pr_cont("\n");
}
if (panic_on_warn)
panic("scheduling while atomic\n");

#ifdef CONFIG_PANIC_ON_SCHED_BUG
BUG();
#endif
dump_stack();
add_taint(TAINT_WARN, LOCKDEP_STILL_OK);
panic("scheduling while atomic\n");
}

/*
Expand Down

0 comments on commit 2c5530c

Please sign in to comment.