Skip to content
Snippets Groups Projects
Commit f23691cc authored by Zhu Kaiqian's avatar Zhu Kaiqian Committed by Todd Kjos
Browse files

BACKPORT: FROMGIT: stop_machine: Fix rcu_momentary_dyntick_idle() call in multi_cpu_stop()

The multi_cpu_stop() contains a loop that can initially be executed with
interrupts enabled (in the MULTI_STOP_NONE and MULTI_STOP_PREPARE states).
Interrupts are guaranteed to be once the MULTI_STOP_DISABLE_IRQ state
is reached.  Unfortunately, the rcu_momentary_eqs() function that is
currently invoked on each pass through this loop requires that interrupts
be disabled.

This commit therefore moves this call to rcu_momentary_eqs() to the body
of the "else if (curstate > MULTI_STOP_PREPARE)" portion of the loop, thus
guaranteeing that interrupts will be disabled on each call, as required.

Kudos to 朱恺乾 (Kaiqian) for noting that this had not made it to mainline.

[ paulmck: Update from rcu_momentary_dyntick_idle() to rcu_momentary_eqs(). ]

Link: https://lore.kernel.org/all/1712649736-27058-1-git-send-email-quic_mojha@quicinc.com/



Signed-off-by: default avatarMukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>

Bug: 389563967
(cherry picked from commit c861cac9
 https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

 dev)
Change-Id: I577fc86e1624239ac612eaa89f51fc1269a3d785
[kaiqian: change rcu_momentary_eqs() back to rcu_momentary_dyntick_idle()]
Signed-off-by: default avatarZhu Kaiqian <zhukaiqian@xiaomi.com>
parent 51531ceb
No related branches found
No related tags found
No related merge requests found
......@@ -251,8 +251,8 @@ static int multi_cpu_stop(void *data)
* be detected and reported on their side.
*/
touch_nmi_watchdog();
rcu_momentary_dyntick_idle();
}
rcu_momentary_dyntick_idle();
} while (curstate != MULTI_STOP_EXIT);
local_irq_restore(flags);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment