Skip to content

treewide, numa_memblks: remove redundant work during NUMA init

Sang-Heon Jeon driver-core linux-acpi linux-devicetree linux-mm lkml loongarch sashiko-reviews 2 versions – Applied

Status from this message: Applied to numa_memblks-redundant-work branch of memblock.git tree, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 4 repliesApplied
  2. v19 patches 3 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/9mm: numa_memblks: set numa_nodes_parsed in numa_add_memblk()mm/numa_memblks.c+17 -30 replies
2/9ACPI: NUMA: remove redundant numa_nodes_parsed node_set()drivers/acpi/numa/srat.c+0 -22 replies
3/9of/numa: remove redundant numa_nodes_parsed node_set()drivers/of/of_numa.c+1 -41 reply
4/9x86/numa: remove redundant numa_nodes_parsed node_set()arch/x86/mm/amdtopology.c arch/x86/mm/numa.c+0 -20 replies
5/9arch_numa: remove redundant numa_nodes_parsed node_set()drivers/base/arch_numa.c+0 -10 replies
6/9LoongArch: remove redundant numa_nodes_parsed node_set()arch/loongarch/kernel/numa.c+0 -10 replies
7/9mm: numa_memblks: remove redundant numa_nodemask_from_meminfo()mm/numa_memblks.c+0 -160 replies
8/9arch_numa: remove redundant node_possible_map assignmentdrivers/base/arch_numa.c+0 -30 replies
9/9mm: numa_memblks: use numa_add_reserved_memblk() in numa_cleanup_meminfo()mm/numa_memblks.c+1 -20 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by.

PatchRob Herring (Arm)
1/9
2/9
3/9A-b
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] treewide, numa_memblks: remove redundant work during NUMA init

Every existing numa_add_memblk() caller passes a valid node id and separately marks that node in numa_nodes_parsed with node_set(). In addition, numa_nodemask_from_meminfo() recomputes the same "nodes that own memory" set from numa_meminfo, which numa_nodes_parsed already contains.

This redundancy implicitly depends on the callers' node_set(). So, before removing the redundancy, make numa_add_memblk() set the node in numa_nodes_parsed explicitly. Then remove the per-caller node_set() and numa_nodemask_from_meminfo().

Also, since the generic numa_register_meminfo() already sets node_possible_map to numa_nodes_parsed, remove the duplicate assignment in arch_numa's numa_register_nodes().

Patch 1 adds the node_set() to numa_add_memblk() itself, so every memblk's node is set in numa_nodes_parsed on add.

Patches 2-6 depend on patch 1 and remove the redundant per-caller node_set() from all callers.

Patch 7 removes both numa_nodemask_from_meminfo() call sites and the unused function itself.

Patch 8 removes the duplicate node_possible_map assignment in arch_numa.

Patch 9 is a minor cleanup, using the existing numa_add_reserved_memblk() wrapper in numa_cleanup_meminfo().

No functional change.

---
Changes from v1 [1]
- remove warning in numa_add_memblk_to() when start == end
- add Acked-by tag
- rebased onto latest mm-new

[1] https://lore.kernel.org/all/[email protected]/
---

Sang-Heon Jeon (9):
mm: numa_memblks: set numa_nodes_parsed in numa_add_memblk()
ACPI: NUMA: remove redundant numa_nodes_parsed node_set() of/numa: remove redundant numa_nodes_parsed node_set() x86/numa: remove redundant numa_nodes_parsed node_set()
arch_numa: remove redundant numa_nodes_parsed node_set()
LoongArch: remove redundant numa_nodes_parsed node_set()
mm: numa_memblks: remove redundant numa_nodemask_from_meminfo()
arch_numa: remove redundant node_possible_map assignment
mm: numa_memblks: use numa_add_reserved_memblk() in
numa_cleanup_meminfo()

 arch/loongarch/kernel/numa.c |  1 -
 arch/x86/mm/amdtopology.c    |  1 -
 arch/x86/mm/numa.c           |  1 -
 drivers/acpi/numa/srat.c     |  2 --
 drivers/base/arch_numa.c     |  4 ----
 drivers/of/of_numa.c         |  5 +----
 mm/numa_memblks.c            | 39 +++++++++++++++++-------------------
 7 files changed, 19 insertions(+), 34 deletions(-)
Signature · 1 line
2.43.0