Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a979047c authored by Kyle Yan's avatar Kyle Yan
Browse files

Revert "sched: Remove synchronize rcu/sched calls from _cpu_down"



This reverts commit c9e8afb8.

Removing the synchronization of rcu/sched calls from _cpu_down introduces
a race where tasks may get queued on an inactive CPU and unthrottling
cfs_rqs.

Change-Id: I3a24314a403fc7352f506cda0016963621c79f6a
Signed-off-by: default avatarKyle Yan <kyan@codeaurora.org>
parent 123357f5
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -8052,6 +8052,20 @@ int sched_cpu_deactivate(unsigned int cpu)
	int ret;

	set_cpu_active(cpu, false);
	/*
	 * We've cleared cpu_active_mask, wait for all preempt-disabled and RCU
	 * users of this state to go away such that all new such users will
	 * observe it.
	 *
	 * For CONFIG_PREEMPT we have preemptible RCU and its sync_rcu() might
	 * not imply sync_sched(), so wait for both.
	 *
	 * Do sync before park smpboot threads to take care the rcu boost case.
	 */
	if (IS_ENABLED(CONFIG_PREEMPT))
		synchronize_rcu_mult(call_rcu, call_rcu_sched);
	else
		synchronize_rcu();

	if (!sched_smp_initialized)
		return 0;