All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20200131061117.PIFGHXwry%akpm@linux-foundation.org>

diff --git a/a/1.txt b/N1/1.txt
index c410740..73fd8fe 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -132,4 +132,25 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  
  	BUG_ON(check_hotplug_memory_range(start, size));
  
--	mem_hotplug_begin();
\ No newline at end of file
+-	mem_hotplug_begin();
+-
+ 	/*
+ 	 * All memory blocks must be offlined before removing memory.  Check
+ 	 * whether all memory blocks in question are offline and return error
+@@ -1778,9 +1776,14 @@ static int __ref try_remove_memory(int n
+ 	/* remove memmap entry */
+ 	firmware_map_remove(start, start + size, "System RAM");
+ 
+-	/* remove memory block devices before removing memory */
++	/*
++	 * Memory block device removal under the device_hotplug_lock is
++	 * a barrier against racing online attempts.
++	 */
+ 	remove_memory_block_devices(start, size);
+ 
++	mem_hotplug_begin();
++
+ 	arch_remove_memory(nid, start, size, NULL);
+ 	memblock_free(start, size);
+ 	memblock_remove(start, size);
+_
\ No newline at end of file
diff --git a/a/content_digest b/N1/content_digest
index b53024f..d9a1860 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -164,7 +164,28 @@
   " \n",
   " \tBUG_ON(check_hotplug_memory_range(start, size));\n",
   " \n",
-  "-\tmem_hotplug_begin();"
+  "-\tmem_hotplug_begin();\n",
+  "-\n",
+  " \t/*\n",
+  " \t * All memory blocks must be offlined before removing memory.  Check\n",
+  " \t * whether all memory blocks in question are offline and return error\n",
+  "\@\@ -1778,9 +1776,14 \@\@ static int __ref try_remove_memory(int n\n",
+  " \t/* remove memmap entry */\n",
+  " \tfirmware_map_remove(start, start + size, \"System RAM\");\n",
+  " \n",
+  "-\t/* remove memory block devices before removing memory */\n",
+  "+\t/*\n",
+  "+\t * Memory block device removal under the device_hotplug_lock is\n",
+  "+\t * a barrier against racing online attempts.\n",
+  "+\t */\n",
+  " \tremove_memory_block_devices(start, size);\n",
+  " \n",
+  "+\tmem_hotplug_begin();\n",
+  "+\n",
+  " \tarch_remove_memory(nid, start, size, NULL);\n",
+  " \tmemblock_free(start, size);\n",
+  " \tmemblock_remove(start, size);\n",
+  "_"
 ]
 
-17f96c78c019e55d9779c336ea8070d8d102961158b2ed9251f692e685ce4dfa
+24054b283bcc1cbec37bef063881d8e26c2f094e0c99e33ab1c5663756bdd5fc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.