]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
rcu: Call touch_nmi_watchdog() while printing stall warnings
authorTejun Heo <tj@kernel.org>
Tue, 9 Jan 2018 18:38:17 +0000 (10:38 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 3caa973b7a260e7a2a69edc94c300ab9c65148c3 ]

When RCU stall warning triggers, it can print out a lot of messages
while holding spinlocks.  If the console device is slow (e.g. an
actual or IPMI serial console), it may end up triggering NMI hard
lockup watchdog like the following.

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/rcu/tree_plugin.h

index db85ca3975f1863626ee2219afbb85f0244773d7..bf05bf9fc088e0fb37cd27a6bcc3e4a9fb67debf 100644 (file)
@@ -561,8 +561,14 @@ static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp)
        }
        t = list_entry(rnp->gp_tasks->prev,
                       struct task_struct, rcu_node_entry);
-       list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry)
+       list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) {
+               /*
+                * We could be printing a lot while holding a spinlock.
+                * Avoid triggering hard lockup.
+                */
+               touch_nmi_watchdog();
                sched_show_task(t);
+       }
        raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
 }
 
@@ -1678,6 +1684,12 @@ static void print_cpu_stall_info(struct rcu_state *rsp, int cpu)
        char *ticks_title;
        unsigned long ticks_value;
 
+       /*
+        * We could be printing a lot while holding a spinlock.  Avoid
+        * triggering hard lockup.
+        */
+       touch_nmi_watchdog();
+
        if (rsp->gpnum == rdp->gpnum) {
                ticks_title = "ticks this GP";
                ticks_value = rdp->ticks_this_gp;