anolis-cloud-kernel/drivers/base
Yang Rong 8dc3571250 anolis: mm/memory_hotplug: support parallel deferred memory online
ANBZ: #18841

Memory hotplug is a serial process that adds memory to Linux in the
granularity of memory blocks. We identified two memory initialization
functions that consume significant time when onling memory blocks:
- `__init_single_page`: initialize the struct page
- `__free_pages_core`: add page to the buddy allocator

We attempted to execute these two functions in parallel during the
process of hotplugging a memory block. The experimental results showed
that when the memory block size was 1GB, the hotplug speed was
increased by approximately 200%. However, when the memory block size
was 128MB, which is the more commonly used size, the hotplug speed
was even worse than that of serial execution.

Therefore, how to improve the hotplug speed when the memory block size
is 128MB remains a challenge.

Here is my idea:
- Defer the execution of these two functions and their associated
  processs to the final phase of the entire hotplug process, so
  that the hotplug speed will no longer be limited by the memory
  block size.
- Perform parallel execution in the final phase, as previous
  implementations have proven that this can accelerate the hotplug
  process.

We introduce the new online function, `deferred_online_memory`, for
deferring the actual online process of memory blocks.

Additionally, we have added a command-line argument,
parallel_hotplug_ratio, which sets the ratio of parallel workers to
the number of CPUs on the node. When parallel_hotplug_ratio is 0,
the memory online process will no longer be deferred.

Signed-off-by: Yang Rong <youngrong@linux.alibaba.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/4622
2025-07-15 01:37:35 +00:00
..
firmware_loader firmware_loader: Block path traversal 2025-03-19 07:14:49 +00:00
power PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() 2024-12-20 04:05:11 +00:00
regmap regmap: debugfs: Fix a erroneous check after snprintf() 2023-12-18 09:47:45 +00:00
test drivers/base: build kunit tests without structleak plugin 2021-03-17 17:06:24 +01:00
Kconfig Add auxiliary bus support 2023-02-10 08:44:44 +00:00
Makefile Add auxiliary bus support 2023-02-10 08:44:44 +00:00
arch_topology.c scheduler: Add runtime knob sysctl_sched_cluster 2024-12-20 01:48:24 +00:00
attribute_container.c scsi: drivers: base: Support atomic version of attribute_container_device_trigger 2020-01-15 22:55:36 -05:00
auxiliary.c driver core: auxiliary bus: make remove function return void 2023-07-04 11:10:18 +00:00
base.h driver core: auxiliary bus: Fix calling stage for auxiliary bus init 2023-02-10 08:44:44 +00:00
bus.c driver core: Flow the return code from ->probe() through to sysfs bind 2022-08-02 16:28:10 +08:00
cacheinfo.c anolis: drivers: base: cacheinfo: export get_cpu_cacheinfo symbol 2022-08-10 15:58:46 +08:00
class.c class: fix possible memory leak in __class_register() 2024-08-16 09:49:14 +00:00
component.c component: Silence bind error on -EPROBE_DEFER 2020-04-28 17:54:15 +02:00
container.c
core.c anolis: phytium: pswiotlb: Add PSWIOTLB mechanism to improve DMA performance 2025-06-16 07:11:40 +00:00
cpu.c tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem 2024-07-25 06:55:43 +00:00
dd.c driver core: Release all resources during unbind before updating device links 2024-08-16 09:49:14 +00:00
devcoredump.c devcoredump: Send uevent once devcd is ready 2024-08-16 09:49:14 +00:00
devres.c devres: Fix memory leakage caused by driver API devm_free_percpu() 2024-11-14 05:40:03 +00:00
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:17:49 +01:00
driver.c drivers: base: Convert to printk alias functions 2020-07-10 14:16:44 +02:00
firmware.c
hypervisor.c
init.c driver core: auxiliary bus: Fix calling stage for auxiliary bus init 2023-02-10 08:44:44 +00:00
isa.c
map.c scsi: remove unused kobj map for sd devie to avoid memleak 2024-12-17 08:57:08 +00:00
memory.c anolis: mm/memory_hotplug: support parallel deferred memory online 2025-07-15 01:37:35 +00:00
module.c
node.c mm: Add support for unaccepted memory 2024-07-10 01:38:34 +00:00
pinctrl.c
platform-msi.c msi: dynamic dev_msi 2022-08-02 16:28:02 +08:00
platform.c driver core: platform: Add devm_platform_get_irqs_affinity() 2024-12-17 08:57:08 +00:00
property.c device property: Fix fwnode_graph_devcon_match() fwnode leak 2022-01-27 10:54:25 +01:00
soc.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
swnode.c software node: balance refcount for managed software nodes 2022-08-02 16:41:10 +08:00
syscore.c syscore: Use pm_pr_dbg() for syscore_{suspend,resume}() 2020-09-08 13:32:06 +02:00
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-03-27 05:34:44 +00:00
transport_class.c scsi: drivers: base: Propagate errors through the transport component 2020-01-15 22:55:37 -05:00