Unverified Commit 06ea25a8 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 0a41c492 4347224d
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -1112,11 +1112,33 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
	return ret;
}

struct cpu_down_work {
	unsigned int		cpu;
	enum cpuhp_state	target;
};

static long __cpu_down_maps_locked(void *arg)
{
	struct cpu_down_work *work = arg;

	return _cpu_down(work->cpu, 0, work->target);
}

static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target)
{
	struct cpu_down_work work = { .cpu = cpu, .target = target, };

	if (cpu_hotplug_disabled)
		return -EBUSY;
	return _cpu_down(cpu, 0, target);

	/*
	 * Ensure that the control task does not run on the to be offlined
	 * CPU to prevent a deadlock against cfs_b->period_timer.
	 */
	cpu = cpumask_any_but(cpu_online_mask, cpu);
	if (cpu >= nr_cpu_ids)
		return -EBUSY;
	return work_on_cpu(cpu, __cpu_down_maps_locked, &work);
}

static int cpu_down(unsigned int cpu, enum cpuhp_state target)