linux/drivers
Yasuaki Ishimatsu 3464046824 numa, cpu hotplug: change links of CPU and node when changing node number by onlining CPU
When booting x86 system contains memoryless node, node numbers of CPUs
on memoryless node were changed to nearest online node number by
init_cpu_to_node() because the node is not online.

In my system, node numbers of cpu#30-44 and 75-89 were changed from 2 to
0 as follows:

  $ numactl --hardware
  available: 2 nodes (0-1)
  node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 30 31 32 33 34 35 36 37 38 39 40
  41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 75 76 77 78 79 80 81 82
  83 84 85 86 87 88 89
  node 0 size: 32394 MB
  node 0 free: 27898 MB
  node 1 cpus: 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 60 61 62 63 64 65 66
  67 68 69 70 71 72 73 74
  node 1 size: 32768 MB
  node 1 free: 30335 MB

If we hot add memory to memoryless node and offine/online all CPUs on
the node, node numbers of these CPUs are changed to correct node numbers
by srat_detect_node() because the node become online.

In this case, node numbers of cpu#30-44 and 75-89 were changed from 0 to
2 in my system as follows:

  $ numactl --hardware
  available: 3 nodes (0-2)
  node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 45 46 47 48 49 50 51 52 53 54 55
  56 57 58 59
  node 0 size: 32394 MB
  node 0 free: 27218 MB
  node 1 cpus: 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 60 61 62 63 64 65 66
  67 68 69 70 71 72 73 74
  node 1 size: 32768 MB
  node 1 free: 30014 MB
  node 2 cpus: 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 75 76 77 78 79 80 81
  82 83 84 85 86 87 88 89
  node 2 size: 16384 MB
  node 2 free: 16384 MB

But "cpu to node" and "node to cpu" links were not changed as follows:

  $ ls /sys/devices/system/cpu/cpu30/|grep node
  node0
  $ ls /sys/devices/system/node/node0/|grep cpu30
  cpu30

"numactl --hardware" shows that cpu30 belongs to node 2.  But sysfs
links does not change.

This patch changes "cpu to node" and "node to cpu" links when node
number changed by onlining CPU.

Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-29 15:54:39 -07:00
..
accessibility
acpi PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
amba ARM: 7675/1: amba: tegra-ahb: Fix build error w/ PM_SLEEP w/o PM_RUNTIME 2013-03-15 17:20:02 +00:00
ata Char / Misc driver update for 3.10-rc1 2013-04-29 11:18:34 -07:00
atm hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
auxdisplay
base numa, cpu hotplug: change links of CPU and node when changing node number by onlining CPU 2013-04-29 15:54:39 -07:00
bcma Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem 2013-03-01 13:52:03 -05:00
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-04-17 12:52:02 -07:00
bluetooth Merge v3.9-rc5 into char-misc-next 2013-04-01 10:50:58 -07:00
bus
cdrom
char Char / Misc driver update for 3.10-rc1 2013-04-29 11:18:34 -07:00
clk clk: tegra: Allow PLLE training to succeed 2013-04-01 11:44:38 -07:00
clocksource ImgTec Meta architecture changes for v3.9-rc1 2013-03-03 12:06:09 -08:00
connector proc connector: reject unprivileged listener bumps 2013-02-27 13:08:35 -05:00
cpufreq cpufreq / intel_pstate: Set timer timeout correctly 2013-04-08 22:09:23 +02:00
cpuidle
crypto crypto: ux500 - add missing comma 2013-04-05 21:02:17 +08:00
dca dca: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
devfreq
dio
dma dmaengine: at_hdmac: fix race condition in atc_advance_work() 2013-04-18 08:54:22 -07:00
edac EDAC: Merge mci.mem_is_per_rank with mci.csbased 2013-03-16 06:32:30 +01:00
eisa PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
extcon This is small fixes for extcon driver. 2013-04-08 16:50:23 -07:00
firewire firewire: convert to idr_alloc() 2013-02-27 19:10:15 -08:00
firmware firmware, memmap: fix firmware_map_entry leak 2013-04-29 15:54:38 -07:00
gpio These are the pinctrl changes for v3.10: 2013-04-29 09:40:35 -07:00
gpu Merge branch '3.10/fb-mmap' into for-next 2013-04-26 09:14:47 +03:00
hid Merge 3.9-rc6 into usb-next 2013-04-08 08:36:40 -07:00
hsi hsi: fix kernel-doc warnings 2013-03-01 13:39:00 -08:00
hv Drivers: hv: vmbus: Fix a bug in hv_need_to_signal() 2013-04-01 12:29:52 -07:00
hwmon Staging driver tree update for 3.10-rc1 2013-04-29 11:34:17 -07:00
hwspinlock hwspinlock: fix __hwspin_lock_request error path 2013-04-05 17:45:11 +03:00
i2c ACPI / I2C: Use parent's ACPI_HANDLE() in acpi_i2c_register_devices() 2013-04-02 15:30:41 +02:00
ide Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
idle intel_idle: additional Haswell CPU-id 2013-03-15 10:55:31 -04:00
iio iio: at91_adc: fix missing Sample and Hold time 2013-04-02 19:22:16 +01:00
infiniband firmware,IB/qib: revert firmware file move 2013-04-05 12:19:39 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2013-04-19 09:15:13 -07:00
iommu PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
ipack ipack: split ipack_device_register() in several functions 2013-03-15 12:23:09 -07:00
irqchip irqchip: gic: fix irq_trigger return 2013-03-26 20:52:25 +01:00
isdn TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
leds
lguest All trivial, thanks to the stuff which didn't quite make it time. 2013-02-26 14:49:12 -08:00
macintosh
mailbox mailbox, pl320-ipc: remove __init from probe function 2013-03-04 14:23:11 +01:00
md Revert "block: add missing block_bio_complete() tracepoint" 2013-04-18 09:00:26 -07:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-04-26 08:17:07 -07:00
memory memory: emif: Load the correct custom config values from dt 2013-03-25 13:18:13 -07:00
memstick memstick: move the dereference below the NULL test 2013-02-27 19:10:23 -08:00
message
mfd extcon: arizona: Updates for v3.10 2013-04-03 11:28:18 -07:00
misc misc: mark spear13xx-pcie-gadget as broken 2013-04-23 10:32:04 -07:00
mmc TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
mtd mtdchar: remove no-longer-used vma helpers 2013-04-19 10:05:39 -07:00
net USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00
nfc NFC: microread: Fix build failure due to a new MEI bus API 2013-04-01 00:52:42 +02:00
ntb
nubus
of
oprofile fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
parisc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
parport parport: use kmemdup instead of kmalloc + memcpy 2013-03-25 10:42:06 -07:00
pci PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
pcmcia
pinctrl pinctrl: move subsystem mutex to pinctrl_dev struct 2013-04-26 17:01:35 +02:00
platform Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 2013-04-18 15:14:34 -07:00
pnp ACPI / glue: Add .match() callback to struct acpi_bus_type 2013-03-04 14:23:40 +01:00
power usb: phy: remove CONFIG_USB_OTG_UTILS 2013-03-18 11:18:08 +02:00
pps drivers/pps/clients/pps-gpio.c: use devm_kzalloc 2013-02-27 19:10:23 -08:00
ps3
ptp
pwm
rapidio
regulator Merge remote-tracking branch 'regulator/fix/twl' into tmp 2013-03-05 10:12:43 +08:00
remoteproc remoteproc: fix FW_CONFIG typo 2013-04-07 15:11:27 +03:00
rpmsg rpmsg: convert to idr_alloc() 2013-02-27 19:10:18 -08:00
rtc Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR" 2013-04-05 09:36:53 -07:00
s390 TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
sbus bbc_i2c: fix section mismatch warning 2013-03-31 19:29:12 -04:00
scsi PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
sfi
sh
sn
spi spi: Fixes for v3.9 2013-04-05 10:04:41 -07:00
ssb ssb: implement spurious tone avoidance 2013-04-10 10:31:26 -04:00
ssbi SSBI: Remove MSM_ prefix from SSBI drivers 2013-03-25 10:39:40 -07:00
staging TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
target target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs 2013-04-11 01:48:49 -07:00
tc
thermal thermal: exynos_thermal: return a proper error code while thermal_zone_device_register fail. 2013-03-11 23:09:29 +08:00
tty TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
uio drivers: uio: Fix UIO device registration failure 2013-03-29 09:08:22 -07:00
usb USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00
uwb
vfio PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-04-12 15:26:42 -07:00
video drivers/video/mmp: remove legacy hw definitions 2013-04-29 15:54:27 -07:00
virt
virtio All trivial, thanks to the stuff which didn't quite make it time. 2013-02-26 14:49:12 -08:00
vlynq
vme
w1 ASoC/extcon: arizona: Fix interaction between HPDET and headphone outputs 2013-03-26 09:19:02 -07:00
watchdog watchdog: Revert the AT91RM9200_WATCHDOG dependency 2013-04-14 09:09:10 +02:00
xen Features: 2013-04-29 08:16:51 -07:00
zorro
Kconfig add single-wire serial bus interface (SSBI) driver 2013-03-25 10:33:56 -07:00
Makefile USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00