linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
@ 2022-09-30  8:52 zhaogongyi
  2022-09-30  8:56 ` David Hildenbrand
  0 siblings, 1 reply; 8+ messages in thread
From: zhaogongyi @ 2022-09-30  8:52 UTC (permalink / raw)
  To: David Hildenbrand, linux-doc, linux-kernel, linux-mm, linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah

Hi!

> 
> On 30.09.22 08:35, 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         | 21
> ++++++++++++++-----
> >   1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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,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?

In my opinion, if online a memory node failed ,it should be a kernel bug catched, so, I think the output here is needed.

Thanks!

Gongyi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
  2022-09-30  8:52 [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit zhaogongyi
@ 2022-09-30  8:56 ` David Hildenbrand
  0 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand @ 2022-09-30  8:56 UTC (permalink / raw)
  To: zhaogongyi, linux-doc, linux-kernel, linux-mm, linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah

On 30.09.22 10:52, zhaogongyi wrote:
> Hi!
> 
>>
>> On 30.09.22 08:35, 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         | 21
>> ++++++++++++++-----
>>>    1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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,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?
> 
> 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?

-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
@ 2022-10-11  1:48 zhaogongyi
  0 siblings, 0 replies; 8+ messages in thread
From: zhaogongyi @ 2022-10-11  1:48 UTC (permalink / raw)
  To: Shuah Khan, David Hildenbrand, linux-doc, linux-kernel, linux-mm,
	linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah

Hi Shuah, David,

I am sorry for my slow response, I have submit a new patch to fix it. Please see: https://patchwork.kernel.org/project/linux-kselftest/patch/20221011013926.200774-1-zhaogongyi@huawei.com/

Thanks,
Gongyi

> 
> On 10/10/22 00:54, David Hildenbrand wrote:
> > On 08.10.22 03:40, zhaogongyi wrote:
> 
> >>
> >> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
  2022-10-10  6:54 ` David Hildenbrand
@ 2022-10-10 17:02   ` Shuah Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Shuah Khan @ 2022-10-10 17:02 UTC (permalink / raw)
  To: David Hildenbrand, zhaogongyi, linux-doc, linux-kernel, linux-mm,
	linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah, Shuah Khan

On 10/10/22 00:54, David Hildenbrand wrote:
> On 08.10.22 03:40, zhaogongyi wrote:

>>
>> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
  2022-10-08  1:40 zhaogongyi
@ 2022-10-10  6:54 ` David Hildenbrand
  2022-10-10 17:02   ` Shuah Khan
  0 siblings, 1 reply; 8+ messages in thread
From: David Hildenbrand @ 2022-10-10  6:54 UTC (permalink / raw)
  To: zhaogongyi, linux-doc, linux-kernel, linux-mm, linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah

On 08.10.22 03:40, zhaogongyi wrote:
> Hi!
> 
>>
>> On 30.09.22 10:52, zhaogongyi wrote:
>>> Hi!
>>>
>>>>
>>>> On 30.09.22 08:35, 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         | 21
>>>> ++++++++++++++-----
>>>>>     1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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,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?
>>>
>>> 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.

-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
@ 2022-10-08  1:40 zhaogongyi
  2022-10-10  6:54 ` David Hildenbrand
  0 siblings, 1 reply; 8+ messages in thread
From: zhaogongyi @ 2022-10-08  1:40 UTC (permalink / raw)
  To: David Hildenbrand, linux-doc, linux-kernel, linux-mm, linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah

Hi!

> 
> On 30.09.22 10:52, zhaogongyi wrote:
> > Hi!
> >
> >>
> >> On 30.09.22 08:35, 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         | 21
> >> ++++++++++++++-----
> >>>    1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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,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?
> >
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
  2022-09-30  6:35 ` [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit Zhao Gongyi
@ 2022-09-30  8:33   ` David Hildenbrand
  0 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand @ 2022-09-30  8:33 UTC (permalink / raw)
  To: Zhao Gongyi, linux-doc, linux-kernel, linux-mm, linux-kselftest
  Cc: akinobu.mita, corbet, osalvador, shuah

On 30.09.22 08:35, 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         | 21 ++++++++++++++-----
>   1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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,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?


-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit
  2022-09-30  6:35 [PATCH -next v5 0/4] Optimize and bugfix for memory-hotplug Zhao Gongyi
@ 2022-09-30  6:35 ` Zhao Gongyi
  2022-09-30  8:33   ` David Hildenbrand
  0 siblings, 1 reply; 8+ messages in thread
From: Zhao Gongyi @ 2022-09-30  6:35 UTC (permalink / raw)
  To: linux-doc, linux-kernel, linux-mm, linux-kselftest
  Cc: akinobu.mita, corbet, david, osalvador, shuah, zhaogongyi

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         | 21 ++++++++++++++-----
 1 file changed, 16 insertions(+), 5 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 1d87611a7d52..91a7457616bb 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,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
+			retval=1
+		fi
+	done
+}
+
 error=-12
 priority=0
 # Run with default of ratio=2 for Kselftest run
@@ -275,11 +285,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
-	if ! online_memory_expect_success $memory; then
-		retval=1
-	fi
-done
+online_all_offline_memory

 #
 # Test memory hot-remove error handling (online => offline)
@@ -296,4 +302,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_offline_memory
+
 exit $retval
--
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-11  1:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-30  8:52 [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit zhaogongyi
2022-09-30  8:56 ` David Hildenbrand
  -- strict thread matches above, loose matches on Subject: below --
2022-10-11  1:48 zhaogongyi
2022-10-08  1:40 zhaogongyi
2022-10-10  6:54 ` David Hildenbrand
2022-10-10 17:02   ` Shuah Khan
2022-09-30  6:35 [PATCH -next v5 0/4] Optimize and bugfix for memory-hotplug Zhao Gongyi
2022-09-30  6:35 ` [PATCH -next v5 2/4] selftests/memory-hotplug: Restore memory before exit Zhao Gongyi
2022-09-30  8:33   ` 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).