Skip to content

RFC Small cleanup for hotplugmem

[email protected] linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm/memory_hotplug: Make add_memory_resource use __try_online_nodemm/memory_hotplug.c+34 -270 replies
2/3mm/memory_hotplug: Call register_mem_sect_under_nodedrivers/base/memory.c mm/memory_hotplug.c+18 -240 replies
3/3mm/memory_hotplug: Get rid of link_mem_sectionsdrivers/base/node.c include/linux/node.h mm/memory_hotplug.c+23 -530 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/3] Small cleanup for hotplugmem

From: Oscar Salvador <[email protected]>

Hi guys,

I wanted to give it a chance a do a small cleanup in the hotplug memory code. A lot more could be done, but I wanted to start somewhere.
I tried to unify/remove duplicated code.

Here I have just done three things

1) add_memory_resource() had code to allocate a node in case it was offline. Since try_online_node already does that, I just made add_memory_resource() to use that function.
This is better explained in patch 1/3.

2) register_mem_sect_under_node() will be called only from link_mem_sections

3) Get rid of link_mem_sections() in favour of walk_memory_range with a callback to register_mem_sect_under_node()

I am posting this as a RFC because I could not see that these patches break anything, but expert eyes might see something that I am missing here.

Oscar Salvador (3):
mm/memory_hotplug: Make add_memory_resource use __try_online_node mm/memory_hotplug: Call register_mem_sect_under_node mm/memory_hotplug: Get rid of link_mem_sections

 drivers/base/memory.c |   2 -
 drivers/base/node.c   |  47 +++++------------------
 include/linux/node.h  |  21 +++++------
 mm/memory_hotplug.c   | 101 ++++++++++++++++++++++++++------------------------
 4 files changed, 71 insertions(+), 100 deletions(-)
Signature · 1 line
2.13.6