alistair23-linux/drivers/base
David Hildenbrand 5f47adf762 mm/memory_hotplug: allow to specify a default online_type
For now, distributions implement advanced udev rules to essentially
- Don't online any hotplugged memory (s390x)
- Online all memory to ZONE_NORMAL (e.g., most virt environments like
  hyperv)
- Online all memory to ZONE_MOVABLE in case the zone imbalance is taken
  care of (e.g., bare metal, special virt environments)

In summary: All memory is usually onlined the same way, however, the
kernel always has to ask user space to come up with the same answer.
E.g., Hyper-V always waits for a memory block to get onlined before
continuing, otherwise it might end up adding memory faster than
onlining it, which can result in strange OOM situations.  This waiting
slows down adding of a bigger amount of memory.

Let's allow to specify a default online_type, not just "online" and
"offline".  This allows distributions to configure the default online_type
when booting up and be done with it.

We can now specify "offline", "online", "online_movable" and
"online_kernel" via
- "memhp_default_state=" on the kernel cmdline
- /sys/devices/system/memory/auto_online_blocks
just like we are able to specify for a single memory block via
/sys/devices/system/memory/memoryX/state

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Yumei Huang <yuhuang@redhat.com>
Link: http://lkml.kernel.org/r/20200317104942.11178-9-david@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-04-07 10:43:41 -07:00
..
firmware_loader firmware: Add new platform fallback mechanism and firmware_request_platform() 2020-03-20 14:54:04 +01:00
power Additional power management updates for 5.7-rc1 2020-04-06 10:14:39 -07:00
regmap
test
arch_topology.c arm64 updates for 5.7: 2020-03-31 10:05:01 -07:00
attribute_container.c
base.h
bus.c
cacheinfo.c
class.c
component.c component: allow missing unbind callback 2020-03-18 14:13:33 +01:00
container.c
core.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-03-31 17:29:33 -07:00
cpu.c CPU (hotplug) updates: 2020-03-30 18:06:39 -07:00
dd.c driver core: Replace open-coded list_last_entry() 2020-03-24 13:33:26 +01:00
devcon.c
devcoredump.c
devres.c
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c mm/memory_hotplug: allow to specify a default online_type 2020-04-07 10:43:41 -07:00
module.c
node.c mm/sparse: rename pfn_present() to pfn_in_present_section() 2020-04-02 09:35:30 -07:00
pinctrl.c
platform-msi.c
platform.c driver core: platform: Reimplement devm_platform_ioremap_resource 2020-03-24 12:09:40 +01:00
property.c device property: Export fwnode_get_name() 2020-03-16 07:47:58 +01:00
soc.c
swnode.c Revert "software node: Simplify software_node_release() function" 2020-03-04 22:31:44 +01:00
syscore.c
topology.c
transport_class.c