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

Commit da69d8be authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: Don't fail isolation request for an already isolated CPU"

parents 0785adc5 40bd7878
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -5977,12 +5977,6 @@ int sched_isolate_cpu(int cpu)

	cpumask_andnot(&avail_cpus, cpu_online_mask, cpu_isolated_mask);

	/* We cannot isolate ALL cpus in the system */
	if (cpumask_weight(&avail_cpus) == 1) {
		ret_code = -EINVAL;
		goto out;
	}

	if (!cpu_online(cpu)) {
		ret_code = -EINVAL;
		goto out;
@@ -5991,6 +5985,13 @@ int sched_isolate_cpu(int cpu)
	if (++cpu_isolation_vote[cpu] > 1)
		goto out;

	/* We cannot isolate ALL cpus in the system */
	if (cpumask_weight(&avail_cpus) == 1) {
		--cpu_isolation_vote[cpu];
		ret_code = -EINVAL;
		goto out;
	}

	/*
	 * There is a race between watchdog being enabled by hotplug and
	 * core isolation disabling the watchdog. When a CPU is hotplugged in