Skip to contentSkip to conversation

selftests/memory-hotplug: Restore memory before exit

PATCH zhaogongyi 3 participants 3 messages Oct 8, 2022 – Oct 10, 2022

Subsystems (3)
lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

Hi!

Quoted 32 lines · zhaogongyi
Quoted 30 lines

Hi!

Quoted 27 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         | 21

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

Review

Quoted 3 lines
   1 file changed, 16 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh

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

Quoted 12 lines

index 1d87611a7d52..91a7457616bb 100755

tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +5 -0
@@ -134,6 +134,16 @@ offline_memory_expect_fail()
   	return 0
   }
 
+online_all_offline_memory()
+{
+	for memory in `hotpluggable_offline_memory`; do
+		if ! online_memory_expect_success $memory; then
+			echo "$FUNCNAME $memory: unexpected fail" >&2

Do we need that output?

Quoted 4 lines
Quoted 1 line

In my opinion, if online a memory node failed ,it should be a kernel bug

catched, so, I think the output here is needed.

But online_memory_expect_success() already prints a warning, no?

Yes, online_memory_expect_success() already prints a warning, remove the warning in online_all_offline_memory() seems ok,

My previous consideration was that one more log information would make it easier to locate the wrong location.

Best Regards,
Gongyi

#1 lore raw
Quoted 34 lines · zhaogongyi

Hi!

Quoted 32 lines · zhaogongyi
Quoted 30 lines

Hi!

Quoted 27 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         | 21

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

Review

Quoted 3 lines
    1 file changed, 16 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh

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

Quoted 12 lines

index 1d87611a7d52..91a7457616bb 100755

tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +5 -0
@@ -134,6 +134,16 @@ offline_memory_expect_fail()
    	return 0
    }
 
+online_all_offline_memory()
+{
+	for memory in `hotpluggable_offline_memory`; do
+		if ! online_memory_expect_success $memory; then
+			echo "$FUNCNAME $memory: unexpected fail" >&2

Do we need that output?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

In my opinion, if online a memory node failed ,it should be a kernel bug

catched, so, I think the output here is needed.

But online_memory_expect_success() already prints a warning, no?

Yes, online_memory_expect_success() already prints a warning, remove the warning in online_all_offline_memory() seems ok,

My previous consideration was that one more log information would make it easier to locate the wrong location.

Let's keep it simple unless there is real reason to warn twice.

Signature · 3 lines
Thanks,

David / dhildenb
maintainer
#2 lore raw
Quoted 9 lines · David Hildenbrand
Quoted 4 lines · zhaogongyi

Yes, online_memory_expect_success() already prints a warning, remove the warning in online_all_offline_memory() seems ok,

My previous consideration was that one more log information would make it easier to locate the wrong location.

Let's keep it simple unless there is real reason to warn twice.

zhaogongyi,

Please note that I already applied the patches to linux-kselftest next for my second pull request before the merge window. Please send the change David requested in a separate patch on top of next as a fix.

thanks,
-- Shuah