mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
Revert "ANDROID: cpu-hotplug: Always use real time scheduling when hotplugging a CPU"
This reverts commit c6e5f9d7cf.
This causes merge problems with 5.19-rc1 and should no longer be needed
anymore.
If it is needed, please work to get the needed changes upstream first,
these should not be sticking around in the Android tree for no good
reason.
Bug: 169238689
Cc: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Cc: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ifb7cf847cf185fb81b79b4fe31f8e5b8ccee8eba
This commit is contained in:
parent
d014869ae8
commit
b53bc74c6c
47
kernel/cpu.c
47
kernel/cpu.c
|
|
@ -35,7 +35,6 @@
|
|||
#include <linux/percpu-rwsem.h>
|
||||
#include <linux/cpuset.h>
|
||||
#include <linux/random.h>
|
||||
#include <uapi/linux/sched/types.h>
|
||||
|
||||
#include <trace/events/power.h>
|
||||
#define CREATE_TRACE_POINTS
|
||||
|
|
@ -1325,27 +1324,6 @@ void cpuhp_online_idle(enum cpuhp_state state)
|
|||
complete_ap_thread(st, true);
|
||||
}
|
||||
|
||||
static int switch_to_rt_policy(void)
|
||||
{
|
||||
struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
|
||||
unsigned int policy = current->policy;
|
||||
|
||||
if (policy == SCHED_NORMAL)
|
||||
/* Switch to SCHED_FIFO from SCHED_NORMAL. */
|
||||
return sched_setscheduler_nocheck(current, SCHED_FIFO, ¶m);
|
||||
else if (policy == SCHED_FIFO || policy == SCHED_RR)
|
||||
return 1;
|
||||
else
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
static int switch_to_fair_policy(void)
|
||||
{
|
||||
struct sched_param param = { .sched_priority = 0 };
|
||||
|
||||
return sched_setscheduler_nocheck(current, SCHED_NORMAL, ¶m);
|
||||
}
|
||||
|
||||
/* Requires cpu_add_remove_lock to be held */
|
||||
static int _cpu_up(unsigned int cpu, int tasks_frozen, enum cpuhp_state target)
|
||||
{
|
||||
|
|
@ -1410,7 +1388,6 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen, enum cpuhp_state target)
|
|||
static int cpu_up(unsigned int cpu, enum cpuhp_state target)
|
||||
{
|
||||
int err = 0;
|
||||
int switch_err;
|
||||
|
||||
if (!cpu_possible(cpu)) {
|
||||
pr_err("can't online cpu %d because it is not configured as may-hotadd at boot time\n",
|
||||
|
|
@ -1421,23 +1398,9 @@ static int cpu_up(unsigned int cpu, enum cpuhp_state target)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* CPU hotplug operations consists of many steps and each step
|
||||
* calls a callback of core kernel subsystem. CPU hotplug-in
|
||||
* operation may get preempted by other CFS tasks and whole
|
||||
* operation of cpu hotplug in CPU gets delayed. Switch the
|
||||
* current task to SCHED_FIFO from SCHED_NORMAL, so that
|
||||
* hotplug in operation may complete quickly in heavy loaded
|
||||
* conditions and new CPU will start handle the workload.
|
||||
*/
|
||||
|
||||
switch_err = switch_to_rt_policy();
|
||||
if (switch_err < 0)
|
||||
return switch_err;
|
||||
|
||||
err = try_online_node(cpu_to_node(cpu));
|
||||
if (err)
|
||||
goto switch_out;
|
||||
return err;
|
||||
|
||||
cpu_maps_update_begin();
|
||||
|
||||
|
|
@ -1453,14 +1416,6 @@ static int cpu_up(unsigned int cpu, enum cpuhp_state target)
|
|||
err = _cpu_up(cpu, 0, target);
|
||||
out:
|
||||
cpu_maps_update_done();
|
||||
switch_out:
|
||||
if (!switch_err) {
|
||||
switch_err = switch_to_fair_policy();
|
||||
if (switch_err)
|
||||
pr_err("Hotplug policy switch err=%d Task %s pid=%d\n",
|
||||
switch_err, current->comm, current->pid);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user