Re: [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09.09.22 09:51, Zhao Gongyi wrote:
Some momory will be left in offline state when calling
offline_memory_expect_fail() failed. Restore it before exit.

Signed-off-by: Zhao Gongyi <zhaogongyi@xxxxxxxxxx>
---
  .../memory-hotplug/mem-on-off-test.sh         | 24 +++++++++++++------
  1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
index 3bdf3c4d6d06..259fd8978639 100755
--- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
+++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
@@ -134,6 +134,17 @@ offline_memory_expect_fail()
  	return 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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux