Comment 6 for bug 1862312

Revision history for this message
Marcelo Cerri (mhcerri) wrote :

A possible cause might be the Bionic commit 483735440add (mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock) that was backported from the upstream commit 381eab4a6ee8.

It seems the location of the new call to mem_hotplug_being() was shifted:

-->8--
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6cd0c4a144d5..7dd8b84ea849 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -891,6 +891,8 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
  int ret;
  struct memory_notify arg;

+ mem_hotplug_begin();
+
  nid = pfn_to_nid(pfn);
  /* associate pfn range with the zone */
  zone = move_pfn_range(online_type, nid, pfn, nr_pages);
@@ -904,8 +906,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
  if (ret)
   goto failed_addition;

- mem_hotplug_begin();
-
  /*
   * If this zone is not populated, then it is not in zonelist.
   * This means the page allocator ignores this zone.
@@ -1178,9 +1178,7 @@ int __ref add_memory_resource(int nid, struct resource *res, bool online)
   walk_memory_range(PFN_DOWN(start), PFN_UP(start + size - 1),
       NULL, online_memory_block);

-
  return ret;
-
 error:
  /* rollback pgdat allocation and others */
  if (new_pgdat && pgdat)
-->8--

I will build a test kernel with this change to test it.