Skip to content

RFC Enable memoryless node on x86 platforms

Jiang Liu cgroups kvm linux-arm-kernel linux-devicetree linux-hotplug linux-mm linux-pm linux-rdma linux-scsi lkml netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest30 patches 59 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30mm, kernel: Use cpu_to_mem()/numa_mem_id() to support memoryless nodekernel/rcu/rcutorture.c kernel/smp.c kernel/smpboot.c +2 more+5 -54 replies
2/30mm, sched: Use cpu_to_mem()/numa_mem_id() to support memoryless nodekernel/sched/core.c kernel/sched/deadline.c kernel/sched/fair.c +1 more+10 -100 replies
3/30mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless nodenet/core/dev.c net/core/flow.c net/core/pktgen.c +1 more+10 -100 replies
4/30mm, netfilter: Use cpu_to_mem()/numa_mem_id() to support memoryless nodenet/netfilter/x_tables.c+4 -40 replies
5/30mm, perf: Use cpu_to_mem()/numa_mem_id() to support memoryless nodekernel/events/callchain.c kernel/events/core.c kernel/events/ring_buffer.c+3 -30 replies
6/30mm, tracing: Use cpu_to_mem()/numa_mem_id() to support memoryless nodekernel/trace/ring_buffer.c kernel/trace/trace_uprobe.c+7 -70 replies
7/30mm: Use cpu_to_mem()/numa_mem_id() to support memoryless nodeinclude/linux/gfp.h mm/memory.c mm/percpu-vm.c +1 more+6 -616 replies
8/30mm, thp: Use cpu_to_mem()/numa_mem_id() to support memoryless nodemm/huge_memory.c+3 -30 replies
9/30mm, memcg: Use cpu_to_mem()/numa_mem_id() to support memoryless nodemm/memcontrol.c+1 -12 replies
10/30mm, xfrm: Use cpu_to_mem()/numa_mem_id() to support memoryless nodenet/xfrm/xfrm_ipcomp.c+1 -10 replies
11/30mm, char/mspec.c: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/char/mspec.c+1 -10 replies
12/30mm, IB/qib: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/infiniband/hw/qib/qib_file_ops.c drivers/infiniband/hw/qib/qib_init.c+3 -30 replies
13/30mm, i40e: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/net/ethernet/intel/i40e/i40e_txrx.c+1 -10 replies
14/30mm, i40evf: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/net/ethernet/intel/i40evf/i40e_txrx.c+1 -10 replies
15/30mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/net/ethernet/intel/igb/igb_main.c+2 -24 replies
16/30mm, ixgbe: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/net/ethernet/intel/ixgbe/ixgbe_main.c+2 -20 replies
17/30mm, intel_powerclamp: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/thermal/intel_powerclamp.c+2 -21 reply
18/30mm, bnx2fc: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/scsi/bnx2fc/bnx2fc_fcoe.c+1 -10 replies
19/30mm, bnx2i: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/scsi/bnx2i/bnx2i_init.c+1 -10 replies
20/30mm, fcoe: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/scsi/fcoe/fcoe.c+1 -10 replies
21/30mm, irqchip: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/irqchip/irq-clps711x.c drivers/irqchip/irq-gic.c+2 -22 replies
22/30mm, of: Use cpu_to_mem()/numa_mem_id() to support memoryless nodedrivers/of/base.c+1 -13 replies
23/30mm, x86: Use cpu_to_mem()/numa_mem_id() to support memoryless nodearch/x86/kernel/apic/io_apic.c arch/x86/kernel/devicetree.c arch/x86/kernel/irq_32.c+8 -80 replies
24/30mm, x86/platform/uv: Use cpu_to_mem()/numa_mem_id() to support memoryless nodearch/x86/platform/uv/tlb_uv.c arch/x86/platform/uv/uv_nmi.c arch/x86/platform/uv/uv_time.c+4 -30 replies
25/30mm, x86, kvm: Use cpu_to_mem()/numa_mem_id() to support memoryless nodearch/x86/kvm/vmx.c+1 -11 reply
26/30mm, x86, perf: Use cpu_to_mem()/numa_mem_id() to support memoryless nodearch/x86/kernel/cpu/perf_event_amd.c arch/x86/kernel/cpu/perf_event_amd_uncore.c arch/x86/kernel/cpu/perf_event_intel.c +3 more+8 -80 replies
27/30x86, numa: Kill useless code to improve code readabilityarch/x86/mm/numa.c+0 -100 replies
28/30mm: Update _mem_id_[] for every possible CPU when memory configuration changesmm/page_alloc.c+5 -52 replies
29/30mm, x86: Enable memoryless node support to better support CPU/memory hotplugarch/x86/Kconfig arch/x86/kernel/acpi/boot.c arch/x86/kernel/smpboot.c +1 more+44 -82 replies
30/30x86, NUMA: Online node earlier when doing CPU hot-additionarch/x86/kernel/acpi/boot.c+1 -03 replies

Reviews trailers per patch

4 of 30 patches have a Reviewed-by or Acked-by.

PatchPaolo BonziniChristoph LameterPaul E. McKenneyJens AxboeJason Cooper
1/30A-b A-b
2/30
3/30
4/30
5/30
6/30
7/30R-b
8/30
9/30
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30
21/30A-b
22/30
23/30
24/30
25/30A-b
26/30
27/30
28/30
29/30
30/30

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [RFC Patch V1 00/30] Enable memoryless node on x86 platforms

Previously we have posted a patch fix a memory crash issue caused by memoryless node on x86 platforms, please refer to
http://comments.gmane.org/gmane.linux.kernel/1687425

As suggested by David Rientjes, the most suitable fix for the issue should be to use cpu_to_mem() rather than cpu_to_node() in the caller. So this is the patchset according to David's suggestion.

Patch 1-26 prepare for enabling memoryless node on x86 platforms by replacing cpu_to_node()/numa_node_id() with cpu_to_mem()/numa_mem_id(). Patch 27-29 enable support of memoryless node on x86 platforms. Patch 30 tunes order to online NUMA node when doing CPU hot-addition.

This patchset fixes the issue mentioned by Mike Galbraith that CPUs are associated with wrong node after adding memory to a memoryless node.

With support of memoryless node enabled, it will correctly report system hardware topology for nodes without memory installed.

root@bkd01sdp:~# numactl --hardware
available: 4 nodes (0-3)
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
node 0 size: 15725 MB
node 0 free: 15129 MB
node 1 cpus: 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
node 1 size: 15862 MB
node 1 free: 15627 MB
node 2 cpus: 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
node 2 size: 0 MB
node 2 free: 0 MB
node 3 cpus: 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
node 3 size: 0 MB
node 3 free: 0 MB
node distances:
node   0   1   2   3
  0:  10  21  21  21
  1:  21  10  21  21
  2:  21  21  10  21
  3:  21  21  21  10

With memoryless node enabled, CPUs are correctly associated with node 2 after memory hot-addition to node 2.

root@bkd01sdp:/sys/devices/system/node/node2# numactl --hardware
available: 4 nodes (0-3)
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
node 0 size: 15725 MB
node 0 free: 14872 MB
node 1 cpus: 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
node 1 size: 15862 MB
node 1 free: 15641 MB
node 2 cpus: 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
node 2 size: 128 MB
node 2 free: 127 MB
node 3 cpus: 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
node 3 size: 0 MB
node 3 free: 0 MB
node distances:
node   0   1   2   3
  0:  10  21  21  21
  1:  21  10  21  21
  2:  21  21  10  21
  3:  21  21  21  10

The patchset is based on the latest mainstream kernel and has been tested on a 4-socket Intel platform with CPU/memory hot-addition capability.

Any comments are welcomed!

Jiang Liu (30):
mm, kernel: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, sched: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, netfilter: Use cpu_to_mem()/numa_mem_id() to support memoryless
node
mm, perf: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, tracing: Use cpu_to_mem()/numa_mem_id() to support memoryless
node
mm: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, thp: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, memcg: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, xfrm: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, char/mspec.c: Use cpu_to_mem()/numa_mem_id() to support
memoryless node
mm, IB/qib: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, i40e: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, i40evf: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, ixgbe: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, intel_powerclamp: Use cpu_to_mem()/numa_mem_id() to support
memoryless node
mm, bnx2fc: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, bnx2i: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, fcoe: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, irqchip: Use cpu_to_mem()/numa_mem_id() to support memoryless
node
mm, of: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, x86: Use cpu_to_mem()/numa_mem_id() to support memoryless node mm, x86/platform/uv: Use cpu_to_mem()/numa_mem_id() to support
memoryless node
mm, x86, kvm: Use cpu_to_mem()/numa_mem_id() to support memoryless
node
mm, x86, perf: Use cpu_to_mem()/numa_mem_id() to support memoryless
node
x86, numa: Kill useless code to improve code readability
mm: Update _mem_id_[] for every possible CPU when memory
configuration changes
mm, x86: Enable memoryless node support to better support CPU/memory
hotplug
x86, NUMA: Online node earlier when doing CPU hot-addition

 arch/x86/Kconfig                              |    3 ++
 arch/x86/kernel/acpi/boot.c                   |    6 ++-
 arch/x86/kernel/apic/io_apic.c                |   10 ++---
 arch/x86/kernel/cpu/perf_event_amd.c          |    2 +-
 arch/x86/kernel/cpu/perf_event_amd_uncore.c   |    2 +-
 arch/x86/kernel/cpu/perf_event_intel.c        |    2 +-
 arch/x86/kernel/cpu/perf_event_intel_ds.c     |    6 +--
 arch/x86/kernel/cpu/perf_event_intel_rapl.c   |    2 +-
 arch/x86/kernel/cpu/perf_event_intel_uncore.c |    2 +-
 arch/x86/kernel/devicetree.c                  |    2 +-
 arch/x86/kernel/irq_32.c                      |    4 +-
 arch/x86/kernel/smpboot.c                     |    2 +
 arch/x86/kvm/vmx.c                            |    2 +-
 arch/x86/mm/numa.c                            |   52 +++++++++++++++++--------
 arch/x86/platform/uv/tlb_uv.c                 |    2 +-
 arch/x86/platform/uv/uv_nmi.c                 |    3 +-
 arch/x86/platform/uv/uv_time.c                |    2 +-
 drivers/char/mspec.c                          |    2 +-
 drivers/infiniband/hw/qib/qib_file_ops.c      |    4 +-
 drivers/infiniband/hw/qib/qib_init.c          |    2 +-
 drivers/irqchip/irq-clps711x.c                |    2 +-
 drivers/irqchip/irq-gic.c                     |    2 +-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   |    2 +-
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c |    2 +-
 drivers/net/ethernet/intel/igb/igb_main.c     |    4 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    4 +-
 drivers/of/base.c                             |    2 +-
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c             |    2 +-
 drivers/scsi/bnx2i/bnx2i_init.c               |    2 +-
 drivers/scsi/fcoe/fcoe.c                      |    2 +-
 drivers/thermal/intel_powerclamp.c            |    4 +-
 include/linux/gfp.h                           |    6 +--
 kernel/events/callchain.c                     |    2 +-
 kernel/events/core.c                          |    2 +-
 kernel/events/ring_buffer.c                   |    2 +-
 kernel/rcu/rcutorture.c                       |    2 +-
 kernel/sched/core.c                           |    8 ++--
 kernel/sched/deadline.c                       |    2 +-
 kernel/sched/fair.c                           |    4 +-
 kernel/sched/rt.c                             |    6 +--
 kernel/smp.c                                  |    2 +-
 kernel/smpboot.c                              |    2 +-
 kernel/taskstats.c                            |    2 +-
 kernel/timer.c                                |    2 +-
 kernel/trace/ring_buffer.c                    |   12 +++---
 kernel/trace/trace_uprobe.c                   |    2 +-
 mm/huge_memory.c                              |    6 +--
 mm/memcontrol.c                               |    2 +-
 mm/memory.c                                   |    2 +-
 mm/page_alloc.c                               |   10 ++---
 mm/percpu-vm.c                                |    2 +-
 mm/vmalloc.c                                  |    2 +-
 net/core/dev.c                                |    6 +--
 net/core/flow.c                               |    2 +-
 net/core/pktgen.c                             |   10 ++---
 net/core/sysctl_net_core.c                    |    2 +-
 net/netfilter/x_tables.c                      |    8 ++--
 net/xfrm/xfrm_ipcomp.c                        |    2 +-
 58 files changed, 139 insertions(+), 111 deletions(-)
Signature · 7 lines
1.7.10.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>