Skip to content

nodemask: switch to runtime nr_node_ids

Yury Norov linux-acpi linux-block linux-mips linux-mm linux-trace-kernel lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11nodemask: add 'small' and 'large' compile-time sizesinclude/linux/nodemask.h+16 -00 replies
2/11nodemask: pass nodemask length to node search functionsinclude/linux/nodemask.h+14 -110 replies
3/11mm/mempolicy: reject migrate_pages source IDs beyond nr_node_idsmm/mempolicy.c+6 -00 replies
4/11mm/mempolicy: preserve full-width userspace nodemasksmm/mempolicy.c+19 -100 replies
5/11mm: switch to runtime nodemask lengthmm/hugetlb_internal.h mm/mempolicy.c mm/mmzone.c +1 more+13 -130 replies
6/11MIPS: IP27: switch nmi_dump to runtime nodemask lengtharch/mips/sgi-ip27/ip27-nmi.c+1 -10 replies
7/11ACPI: NUMA: switch acpi_map_pxm_to_node to runtime nodemask lengthdrivers/acpi/numa/srat.c+1 -10 replies
8/11mtip32xx: switch next_online_node() to runtime nodemask lengthdrivers/block/mtip32xx/mtip32xx.c+1 -10 replies
9/11nodemask: add nodes_copy_and_extend()include/linux/nodemask.h+11 -00 replies
10/11sched/numa: bound cpuset trace masks by nr_node_idsinclude/trace/events/sched.h+4 -30 replies
11/11nodemask: add cpumask-style operation size boundsinclude/linux/nodemask.h+42 -380 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] nodemask: switch to runtime nr_node_ids

Nodemasks have a compile-time capacity of MAX_NUMNODES, and nr_node_ids describes the runtime node ID usage.

Modern distros, like my Ubuntu, default MAX_NUMNODES to 1024, while the actual number of nodes is typically smaller. All nodemask functions currently refer to the MAX_NUMNODES, which adds a substantial overhead on every traversing operation.

This series switches the kernel to runtime length of nodemasks, which also saves up to 8K of .text for minimal config, and accelerates basic nodemask operations ~4x if MAX_NUMNODES == 1024 and nr_node_ids == 2.

Yury Norov (11):
nodemask: add 'small' and 'large' compile-time sizes
nodemask: pass nodemask length to node search functions mm/mempolicy: reject migrate_pages source IDs beyond nr_node_ids mm/mempolicy: preserve full-width userspace nodemasks
mm: switch to runtime nodemask length
MIPS: IP27: switch nmi_dump to runtime nodemask length
ACPI: NUMA: switch acpi_map_pxm_to_node to runtime nodemask length
mtip32xx: switch next_online_node() to runtime nodemask length
nodemask: add nodes_copy_and_extend()
sched/numa: bound cpuset trace masks by nr_node_ids
nodemask: add cpumask-style operation size bounds

 arch/mips/sgi-ip27/ip27-nmi.c     |   2 +-
 drivers/acpi/numa/srat.c          |   2 +-
 drivers/block/mtip32xx/mtip32xx.c |   2 +-
 include/linux/nodemask.h          | 122 +++++++++++++++++++-----------
 include/trace/events/sched.h      |   7 +-
 mm/hugetlb_internal.h             |   2 +-
 mm/mempolicy.c                    |  55 +++++++++-----
 mm/mmzone.c                       |   2 +-
 mm/vmscan.c                       |   2 +-
 9 files changed, 123 insertions(+), 73 deletions(-)
Signature · 1 line
2.53.0