Files
kernel_xiaomi_raphael/kernel/sched
Frederic Weisbecker 8a6d3eaab1 rcu/nocb: Perform deferred wake up before last idle's need_resched() check
Entering RCU idle mode may cause a deferred wake up of an RCU NOCB_GP
kthread (rcuog) to be serviced.

Usually a local wake up happening while running the idle task is handled
in one of the need_resched() checks carefully placed within the idle
loop that can break to the scheduler.

Unfortunately the call to rcu_idle_enter() is already beyond the last
generic need_resched() check and we may halt the CPU with a resched
request unhandled, leaving the task hanging.

Fix this with splitting the rcuog wakeup handling from rcu_idle_enter()
and place it before the last generic need_resched() check in the idle
loop. It is then assumed that no call to call_rcu() will be performed
after that in the idle loop until the CPU is put in low power mode.

Fixes: 96d3fd0d31 (rcu: Break call_rcu() deadlock involving scheduler and perf)
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20210131230548.32970-3-frederic@kernel.org
2022-04-08 09:59:29 +00:00
..
2021-04-12 07:13:38 +00:00
2022-01-22 14:28:43 +00:00
2021-04-12 07:13:38 +00:00
2021-04-12 07:13:38 +00:00
2022-01-19 09:55:12 +00:00
2022-01-22 14:28:43 +00:00
2021-04-12 07:13:38 +00:00
2022-01-22 14:28:43 +00:00
2022-01-22 14:28:43 +00:00
2020-07-27 00:28:46 -07:00
2021-04-12 07:13:38 +00:00