]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rcu: Eliminate BUG_ON() for kernel/rcu/update.c
authorPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 22 Oct 2018 15:33:06 +0000 (08:33 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 12 Nov 2018 16:15:59 +0000 (08:15 -0800)
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>
kernel/rcu/update.c

index f203b94f6b5be1f4e3047a429fa9267c1713ff60..cb26de25658aa58c5918ec5b39f752559782b82d 100644 (file)
@@ -822,7 +822,8 @@ static int __init rcu_spawn_tasks_kthread(void)
        struct task_struct *t;
 
        t = kthread_run(rcu_tasks_kthread, NULL, "rcu_tasks_kthread");
-       BUG_ON(IS_ERR(t));
+       if (WARN_ONCE(IS_ERR(t), "%s: Could not start Tasks-RCU grace-period kthread, OOM is now expected behavior\n", __func__))
+               return 0;
        smp_mb(); /* Ensure others see full kthread. */
        WRITE_ONCE(rcu_tasks_kthread_ptr, t);
        return 0;