Unverified Commit 2c42625d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13413 sched/topology: Prevent race condition in sched_domain topology

parents a7bb3cee 28dac7ae
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1765,7 +1765,13 @@ int sched_cluster_handler(struct ctl_table *table, int write,
	ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
	if (!ret && write) {
		if (oldval != sysctl_sched_cluster) {
			/*
			 * Here may have raced with partition_sched_domains_locked,
			 * it needs to be protected with sched_domains_mutex.
			 */
			mutex_lock(&sched_domains_mutex);
			set_sched_cluster();
			mutex_unlock(&sched_domains_mutex);
			arch_rebuild_cpu_topology();
		}
	}