]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/topology: Update the 'cpu cores' field in /proc/cpuinfo correctly across CPU...
authorSamuel Neves <sneves@dei.uc.pt>
Wed, 21 Feb 2018 20:50:36 +0000 (20:50 +0000)
committerBrian Maly <brian.maly@oracle.com>
Tue, 11 Dec 2018 18:45:17 +0000 (13:45 -0500)
commit1287019e358f6537f918a92e8570fb9afa88e01d
treeaaeb509bff6120a6ac80128a838ce608ea12fc17
parent7806b57b7186cfa05ef2dce9964bc82900438adf
x86/topology: Update the 'cpu cores' field in /proc/cpuinfo correctly across CPU hotplug operations

Without this fix, /proc/cpuinfo will display an incorrect amount
of CPU cores, after bringing them offline and online again, as
exemplified below:

  $ cat /proc/cpuinfo | grep cores
  cpu cores : 4
  cpu cores : 8
  cpu cores : 8
  cpu cores : 20
  cpu cores : 4
  cpu cores : 3
  cpu cores : 2
  cpu cores : 2

This patch fixes this by always zeroing the booted_cores variable
upon turning off a logical CPU.

Tested-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: jgross@suse.com
Cc: luto@kernel.org
Cc: prarit@redhat.com
Cc: vkuznets@redhat.com
Link: http://lkml.kernel.org/r/20180221205036.5244-1-sneves@dei.uc.pt
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 4596749339e06dc7a424fc08a15eded850ed78b7)

Orabug: 28933009

Signed-off-by: Honglei Wang <honglei.wang@oracle.com>
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/smpboot.c