]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 24 Sep 2020 22:11:55 +0000 (15:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:38:59 +0000 (13:38 +0100)
commit3de293bcfe386500e456d766d27f4008592f34e6
treea4923b12e1e8d468d5b13e6f6aa07c594bfefbf7
parent64e893ce8fb08ac1b45f8eb3e03166c20bcab146
rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled

[ Upstream commit c583bcb8f5edd48c1798798e341f78afb9bf4f6f ]

The try_invoke_on_locked_down_task() function requires that
interrupts be enabled, but it is called with interrupts disabled from
rcu_print_task_stall(), resulting in an "IRQs not enabled as expected"
diagnostic.  This commit therefore updates rcu_print_task_stall()
to accumulate a list of the first few tasks while holding the current
leaf rcu_node structure's ->lock, then releases that lock and only then
uses try_invoke_on_locked_down_task() to attempt to obtain per-task
detailed information.  Of course, as soon as ->lock is released, the
task might exit, so the get_task_struct() function is used to prevent
the task structure from going away in the meantime.

Link: https://lore.kernel.org/lkml/000000000000903d5805ab908fc4@google.com/
Fixes: 5bef8da66a9c ("rcu: Add per-task state to RCU CPU stall warnings")
Reported-by: syzbot+cb3b69ae80afd6535b0e@syzkaller.appspotmail.com
Reported-by: syzbot+f04854e1c5c9e913cc27@syzkaller.appspotmail.com
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/tree_stall.h