Skip to content

Commit f0ad56e

Browse files
author
Paul E. McKenney
committed
rcu: Eliminate BUG_ON() for kernel/rcu/update.c
The update.c file has a number of calls to BUG_ON(), which panics the kernel, which is not a good strategy for devices (like embedded) that don't have a way to capture console output. This commit therefore converts these BUG_ON() calls to WARN_ON_ONCE() and WARN_ONCE(). Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
1 parent 9213784 commit f0ad56e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎kernel/rcu/update.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,8 @@ static int __init rcu_spawn_tasks_kthread(void)
822822
struct task_struct *t;
823823

824824
t = kthread_run(rcu_tasks_kthread, NULL, "rcu_tasks_kthread");
825-
BUG_ON(IS_ERR(t));
825+
if (WARN_ONCE(IS_ERR(t), "%s: Could not start Tasks-RCU grace-period kthread, OOM is now expected behavior\n", __func__))
826+
return 0;
826827
smp_mb(); /* Ensure others see full kthread. */
827828
WRITE_ONCE(rcu_tasks_kthread_ptr, t);
828829
return 0;

0 commit comments

Comments
 (0)