Revert "ANDROID: sched: Fix sched_cpu_drain CONFIG_HOTPLUG_CPU dependence"

This reverts commit 6f58dc1f83.

CPU Pause causes major merge conflicts with the 5.11 scheduler changes
(migrate-disable specifically), so lets revert Pause temporarily as it
is not needed urgently in android-mainline.

Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I3eee0317d5e88591e47f7724a32af4339e6a979c
This commit is contained in:
Quentin Perret
2020-12-15 17:54:22 +00:00
parent 1243c202ae
commit 3c252ab080
+34 -34
View File
@@ -6887,40 +6887,6 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf, bool force)
rq->stop = stop;
}
static int drain_rq_cpu_stop(void *data)
{
struct rq *rq = this_rq();
struct rq_flags rf;
rq_lock_irqsave(rq, &rf);
migrate_tasks(rq, &rf, false);
rq_unlock_irqrestore(rq, &rf);
return 0;
}
int sched_cpu_drain_rq(unsigned int cpu)
{
struct cpu_stop_work *rq_drain = &(cpu_rq(cpu)->drain);
struct cpu_stop_done *rq_drain_done = &(cpu_rq(cpu)->drain_done);
if (idle_cpu(cpu)) {
rq_drain->done = NULL;
return 0;
}
return stop_one_cpu_async(cpu, drain_rq_cpu_stop, NULL, rq_drain,
rq_drain_done);
}
void sched_cpu_drain_rq_wait(unsigned int cpu)
{
struct cpu_stop_work *rq_drain = &(cpu_rq(cpu)->drain);
if (rq_drain->done)
cpu_stop_work_wait(rq_drain);
}
#endif /* CONFIG_HOTPLUG_CPU */
void set_rq_online(struct rq *rq)
@@ -7001,6 +6967,40 @@ static int cpuset_cpu_inactive(unsigned int cpu)
return 0;
}
static int drain_rq_cpu_stop(void *data)
{
struct rq *rq = this_rq();
struct rq_flags rf;
rq_lock_irqsave(rq, &rf);
migrate_tasks(rq, &rf, false);
rq_unlock_irqrestore(rq, &rf);
return 0;
}
int sched_cpu_drain_rq(unsigned int cpu)
{
struct cpu_stop_work *rq_drain = &(cpu_rq(cpu)->drain);
struct cpu_stop_done *rq_drain_done = &(cpu_rq(cpu)->drain_done);
if (idle_cpu(cpu)) {
rq_drain->done = NULL;
return 0;
}
return stop_one_cpu_async(cpu, drain_rq_cpu_stop, NULL, rq_drain,
rq_drain_done);
}
void sched_cpu_drain_rq_wait(unsigned int cpu)
{
struct cpu_stop_work *rq_drain = &(cpu_rq(cpu)->drain);
if (rq_drain->done)
cpu_stop_work_wait(rq_drain);
}
int sched_cpu_activate(unsigned int cpu)
{
struct rq *rq = cpu_rq(cpu);