Skip to contentSkip to conversation

selftests/memory-hotplug: Restore memory before exit

PATCH zhaogongyi 1 participant 1 message Sep 15, 2022

Subsystems (3)
lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

Hi,

Thanks for your review, I have submit the patches in a new version as your suggestion.

Best Wishes,
Gongyi

Quoted 45 lines · Zhao Gongyi
Quoted 6 lines

Some momory will be left in offline state when calling offline_memory_expect_fail() failed. Restore it before exit.

---
  .../memory-hotplug/mem-on-off-test.sh         | 24

+++++++++++++------

Quoted 11 lines
  1 file changed, 17 insertions(+), 7 deletions(-)
tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +0 -0
index 3bdf3c4d6d06..259fd8978639 100755
@@ -134,6 +134,17 @@ offline_memory_expect_fail()
  	return 0
  }
 

tools/testing/selftests/memory-hotplug/mem-on-off-test.sh offline_memory_expect_fail() · line 146

Quoted 10 lines
tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +10 -0
+online_all_hot_pluggable_memory()
+{
+
+	for memory in `hotpluggable_offline_memory`; do
+		online_memory_expect_success $memory || {
+			echo "online memory $memory: unexpected fail"
+			retval=1
+		}
+	done
+}

Maybe call it

"online_all_offline_memory()"

instead?

Note that "removable" as used in hotpluggable_memory() will nowadays always return "1" if the kernel supports memory hotunplug, independent of the specific memory block.

--
Thanks,

David / dhildenb