Message ID | 20200319131221.14044-1-david@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/19/20 at 02:12pm, David Hildenbrand wrote: > Distributions nowadays use udev rules ([1] [2]) to specify if and > how to online hotplugged memory. The rules seem to get more complex with > many special cases. Due to the various special cases, > CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE cannot be used. All memory hotplug > is handled via udev rules. > > Everytime we hotplug memory, the udev rule will come to the same > conclusion. Especially Hyper-V (but also soon virtio-mem) add a lot of > memory in separate memory blocks and wait for memory to get onlined by user > space before continuing to add more memory blocks (to not add memory faster > than it is getting onlined). This of course slows down the whole memory > hotplug process. > > To make the job of distributions easier and to avoid udev rules that get > more and more complicated, let's extend the mechanism provided by > - /sys/devices/system/memory/auto_online_blocks > - "memhp_default_state=" on the kernel cmdline > to be able to specify also "online_movable" as well as "online_kernel" > > v2 -> v3: > - "hv_balloon: don't check for memhp_auto_online manually" > -- init_completion() before register_memory_notifier() > - Minor typo fix > > v1 -> v2: > - Tweaked some patch descriptions > - Added > -- "powernv/memtrace: always online added memory blocks" > -- "hv_balloon: don't check for memhp_auto_online manually" > -- "mm/memory_hotplug: unexport memhp_auto_online" > - "mm/memory_hotplug: convert memhp_auto_online to store an online_type" > -- No longer touches hv/memtrace code Ack the series. Reviewed-by: Baoquan He <bhe@redhat.com>
diff --git a/40-redhat.rules b/40-redhat.rules-new index 2c690e5..168fd03 100644 --- a/40-redhat.rules +++ b/40-redhat.rules-new @@ -6,6 +6,9 @@ SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online} # Memory hotadd request SUBSYSTEM!="memory", GOTO="memory_hotplug_end" ACTION!="add", GOTO="memory_hotplug_end" +# memory hotplug behavior configured +PROGRAM=="grep online /sys/devices/system/memory/auto_online_blocks", GOTO="memory_hotplug_end" + PROGRAM="/bin/uname -p", RESULT=="s390*", GOTO="memory_hotplug_end" ENV{.state}="online"