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

Commit 28b9ddf7 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Satya Durga Srinivasu Prabhala
Browse files

cpu-hotplug: Keep atleast 1 online and un-isolated CPU



The PM_QOS_CPU_DMA_LATENCY vote attached to an IRQ is discarded,
if it is affined to an isolated CPU. So we need atleast 1 CPU
in online and un-isolate state. The scheduler rejects isolating
a CPU if it is the only online and un-isolated CPU in the system.
Add the same check for CPU hotplug.

Change-Id: I16ca44a49dbc7ed385378e08a8634e3c0ac94e03
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
[markivx: forward port to 4.14, fix merge conflicts due to new write-lock]
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
[satyap@codeaurora.org: Port to 4.19 and fix merge conflict]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 05fc46b8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -104,6 +104,13 @@ extern struct cpumask __cpu_isolated_mask;
#define num_present_cpus()	cpumask_weight(cpu_present_mask)
#define num_active_cpus()	cpumask_weight(cpu_active_mask)
#define num_isolated_cpus()	cpumask_weight(cpu_isolated_mask)
#define num_online_uniso_cpus()						\
({									\
	cpumask_t mask;							\
									\
	cpumask_andnot(&mask, cpu_online_mask, cpu_isolated_mask);	\
	cpumask_weight(&mask);						\
})
#define cpu_online(cpu)		cpumask_test_cpu((cpu), cpu_online_mask)
#define cpu_possible(cpu)	cpumask_test_cpu((cpu), cpu_possible_mask)
#define cpu_present(cpu)	cpumask_test_cpu((cpu), cpu_present_mask)
@@ -115,6 +122,7 @@ extern struct cpumask __cpu_isolated_mask;
#define num_present_cpus()	1U
#define num_active_cpus()	1U
#define num_isolated_cpus()	0U
#define num_online_uniso_cpus()	1U
#define cpu_online(cpu)		((cpu) == 0)
#define cpu_possible(cpu)	((cpu) == 0)
#define cpu_present(cpu)	((cpu) == 0)
+3 −0
Original line number Diff line number Diff line
@@ -948,6 +948,9 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
	if (!cpu_present(cpu))
		return -EINVAL;

	if (!tasks_frozen && !cpu_isolated(cpu) && num_online_uniso_cpus() == 1)
		return -EBUSY;

	cpus_write_lock();
	if (trace_cpuhp_latency_enabled())
		start_time = sched_clock();