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

Commit bdd41e69 authored by Stepan Moskovchenko's avatar Stepan Moskovchenko Committed by Kyle Yan
Browse files

arm64: show present cpu instead of online cpu in /proc/cpuinfo



Some userspace applications use /proc/cpuinfo to determine how many CPUs
the system has. CPU hotplug can offline a CPU at runtime and causing the
offline CPU not present in /proc/cpuinfo if we only show online cpu in
/proc/cpuinfo. Show all present CPUs in /proc/cpuinfo so that userspace
can take advantage of all availabie CPUs, even though some CPUs may have
been brought offline due to inactivity.

Change-Id: I6afe11e406c4a6ac0dd04d6abac11c2b68b9685a
Signed-off-by: default avatarStepan Moskovchenko <stepanm@codeaurora.org>
[kyan: trivial merge conflict resolution and move changes
         in arch/arm64/kernel from setup.c to cpuinfo.c]
Signed-off-by: default avatarKyle Yan <kyan@codeaurora.org>
parent 5b9b2988
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ static int c_show(struct seq_file *m, void *v)
	int i, j;
	bool compat = personality(current->personality) == PER_LINUX32;

	for_each_online_cpu(i) {
	for_each_present_cpu(i) {
		struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
		u32 midr = cpuinfo->reg_midr;