* Re: [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit
@ 2022-09-15 9:07 zhaogongyi
0 siblings, 0 replies; 3+ messages in thread
From: zhaogongyi @ 2022-09-15 9:07 UTC (permalink / raw)
To: David Hildenbrand, linux-doc, linux-kernel, linux-mm, linux-kselftest
Cc: akinobu.mita, corbet, osalvador, shuah
Hi,
Thanks for your review, I have submit the patches in a new version as your suggestion.
Best Wishes,
Gongyi
>
> 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@huawei.com>
> > ---
> > .../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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit
2022-09-09 7:51 ` [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit Zhao Gongyi
@ 2022-09-09 12:21 ` David Hildenbrand
0 siblings, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2022-09-09 12:21 UTC (permalink / raw)
To: Zhao Gongyi, linux-doc, linux-kernel, linux-mm, linux-kselftest
Cc: akinobu.mita, corbet, osalvador, shuah
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@huawei.com>
> ---
> .../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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit
2022-09-09 7:51 [PATCH -next 0/5] Optimize and bugfix for notifier error Zhao Gongyi
@ 2022-09-09 7:51 ` Zhao Gongyi
2022-09-09 12:21 ` David Hildenbrand
0 siblings, 1 reply; 3+ messages in thread
From: Zhao Gongyi @ 2022-09-09 7:51 UTC (permalink / raw)
To: linux-doc, linux-kernel, linux-mm, linux-kselftest
Cc: akinobu.mita, corbet, david, osalvador, shuah, Zhao Gongyi
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@huawei.com>
---
.../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
+}
+
error=-12
priority=0
# Run with default of ratio=2 for Kselftest run
@@ -278,13 +289,7 @@ done
# Online all hot-pluggable memory
#
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error
-for memory in `hotpluggable_offline_memory`; do
- online_memory_expect_success $memory || {
- echo "online memory $memory: unexpected fail"
- retval=1
- }
-
-done
+online_all_hot_pluggable_memory
#
# Test memory hot-remove error handling (online => offline)
@@ -303,4 +308,9 @@ done
echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
/sbin/modprobe -q -r memory-notifier-error-inject
+#
+# Restore memory before exit
+#
+online_all_hot_pluggable_memory
+
exit $retval
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-15 9:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 9:07 [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit zhaogongyi
-- strict thread matches above, loose matches on Subject: below --
2022-09-09 7:51 [PATCH -next 0/5] Optimize and bugfix for notifier error Zhao Gongyi
2022-09-09 7:51 ` [PATCH -next 4/5] selftests/memory-hotplug: Restore memory before exit Zhao Gongyi
2022-09-09 12:21 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).