From a0ef9ec24144799b5b47fa54c38f9a0f9dfe9a59 Mon Sep 17 00:00:00 2001 From: Paul E. McKenney Date: Mon, 9 Jul 2018 15:50:16 -0700 Subject: rcu: Provide improved interrupt-from-idle check in rcu_check_callbacks() The patch making need_resched() respond to urgent RCU-QS needs used is_idle_task(current) to detect an interrupt from idle, which does work reasonably, but is (in theory at least) vulnerable to loops containing need_resched() invoked from within RCU_NONIDLE() or its tracepoint equivalent. This commit therefore moves rcu_is_cpu_rrupt_from_idle() to a place from which rcu_check_callbacks() can invoke it and replaces the is_idle_task(current) with rcu_is_cpu_rrupt_from_idle(). Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index f47ac7a4719f..77d2cbf7c831 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2474,7 +2474,7 @@ void rcu_check_callbacks(int user) /* The load-acquire pairs with the store-release setting to true. */ if (smp_load_acquire(this_cpu_ptr(&rcu_dynticks.rcu_urgent_qs))) { /* Idle and userspace execution already are quiescent states. */ - if (!is_idle_task(current) && !user) { + if (!rcu_is_cpu_rrupt_from_idle() && !user) { set_tsk_need_resched(current); set_preempt_need_resched(); } -- cgit v1.2.3