Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a82a02a3 authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

mm: memory_hotplug: wait on device_hotplug_lock in OOM path



Use lock_device_hotplug() inplace of lock_device_hotplug_sysfs() as the
latter can return immediately if there are any parallel
onlining/offlining of memory blocks.

Change-Id: Ica3cc286b7d4f87310f86e8c9e6db2157e511419
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent a9013b58
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1120,10 +1120,8 @@ bool try_online_one_block(int nid)
{
	struct zone *zone = &NODE_DATA(nid)->node_zones[ZONE_MOVABLE];
	bool onlined_block = false;
	int ret = lock_device_hotplug_sysfs();

	if (ret)
		return false;
	lock_device_hotplug();

	walk_memory_range(zone->zone_start_pfn, zone_end_pfn(zone),
			  &onlined_block, online_memory_one_block);