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

Commit 49ab4919 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 6e625d33
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1025,10 +1025,8 @@ bool try_online_one_block(int nid)
	struct zone *zone = &NODE_DATA(nid)->node_zones[ZONE_MOVABLE];
	unsigned long zone_start, zone_size;
	bool onlined_block = false;
	int ret = lock_device_hotplug_sysfs();

	if (ret)
		return false;
	lock_device_hotplug();

	zone_start = PFN_PHYS(zone->zone_start_pfn);
	zone_size = zone->spanned_pages << PAGE_SHIFT;