2022-11-01 08:17:40

by kernel test robot

[permalink] [raw]
Subject: [linus:master] [selftests/memory] 13023c33c9: kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail

Hi Gongyi,

We noticed that below commit may change the exit status of
memory-hotplug selftest, please check if the test result is expected.

We got same test log before this commit but with a good exit, though
there were also some "Invalid argument" and "unexpected success" log.
Please help give some guidance if there are any problems in our test
flow. Thanks.


Greeting,

FYI, we noticed kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail due to commit (built with gcc-11):

commit: 13023c33c962730a38d6b43995910c8805637a9a ("selftests/memory-hotplug: Add checking after online or offline")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

in testcase: kernel-selftests
version: kernel-selftests-x86_64-9313ba54-1_20221017
with following parameters:

group: memory-hotplug

test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel.
test-url: https://www.kernel.org/doc/Documentation/kselftest.txt


on test machine: 8 threads Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (Skylake) with 28G memory

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):


2022-10-28 01:04:44 make quicktest=1 run_tests -C memory-hotplug
make: Entering directory '/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-13023c33c962730a38d6b43995910c8805637a9a/tools/testing/selftests/memory-hotplug'
TAP version 13
1..1
# selftests: memory-hotplug: mem-on-off-test.sh
# Test scope: 2% hotplug memory
# online all hot-pluggable memory in offline state:
# SKIPPED - no hot-pluggable memory in offline state
# offline 2% hot-pluggable memory in online state
# trying to offline 5 out of 224 memory block(s):
# online->offline memory0
# ./mem-on-off-test.sh: line 78: echo: write error: Invalid argument
# offline_memory_expect_success 0: unexpected fail
# online->offline memory1
# online->offline memory10
# online->offline memory100
# online->offline memory101
# online->offline memory102
# online all hot-pluggable memory in offline state:
# offline->online memory1
# offline->online memory10
# offline->online memory100
# offline->online memory101
# offline->online memory102
# Test with memory notifier error injection
# ./mem-on-off-test.sh: line 267: echo: write error: Invalid argument
# online_memory_expect_fail 142: unexpected success
# online_memory_expect_fail 190: unexpected success
# ./mem-on-off-test.sh: line 287: echo: write error: Invalid argument
# offline_memory_expect_fail 107: unexpected success
# offline_memory_expect_fail 119: unexpected success
# offline_memory_expect_fail 120: unexpected success
# offline_memory_expect_fail 137: unexpected success
# offline_memory_expect_fail 14: unexpected success
# offline_memory_expect_fail 150: unexpected success
# offline_memory_expect_fail 184: unexpected success
# offline_memory_expect_fail 188: unexpected success
# offline_memory_expect_fail 189: unexpected success
# offline_memory_expect_fail 94: unexpected success
# offline_memory_expect_fail 96: unexpected success
not ok 1 selftests: memory-hotplug: mem-on-off-test.sh # exit=1
make: Leaving directory '/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-13023c33c962730a38d6b43995910c8805637a9a/tools/testing/selftests/memory-hotplug'


If you fix the issue, kindly add following tag
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-lkp/[email protected]


To reproduce:

git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
sudo bin/lkp install job.yaml # job file is attached in this email
bin/lkp split-job --compatible job.yaml # generate the yaml file for lkp run
sudo bin/lkp run generated-yaml-file

# if come across any failure that blocks the test,
# please remove ~/.lkp and /lkp dir to run from a clean state.


--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (4.04 kB)
config-6.0.0-rc1-00015-g13023c33c962 (170.73 kB)
job-script (6.61 kB)
dmesg.xz (28.93 kB)
kernel-selftests (2.88 kB)
job.yaml (5.57 kB)
reproduce (263.00 B)
Download all attachments

2022-11-01 11:28:57

by Zhao Gongyi

[permalink] [raw]
Subject: Re: [linus:master] [selftests/memory] 13023c33c9: kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail

Hi!

>
> Hi Gongyi,
>
> We noticed that below commit may change the exit status of
> memory-hotplug selftest, please check if the test result is expected.
>
> We got same test log before this commit but with a good exit, though
> there were also some "Invalid argument" and "unexpected success" log.
> Please help give some guidance if there are any problems in our test flow.
> Thanks.
>
>
> Greeting,
>
> FYI, we noticed kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail
> due to commit (built with gcc-11):
>
> commit: 13023c33c962730a38d6b43995910c8805637a9a
> ("selftests/memory-hotplug: Add checking after online or offline")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
>
> in testcase: kernel-selftests
> version: kernel-selftests-x86_64-9313ba54-1_20221017
> with following parameters:
>
> group: memory-hotplug
>
> test-description: The kernel contains a set of "self tests" under the
> tools/testing/selftests/ directory. These are intended to be small unit tests
> to exercise individual code paths in the kernel.
> test-url: https://www.kernel.org/doc/Documentation/kselftest.txt
>
>
> on test machine: 8 threads Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
> (Skylake) with 28G memory
>
> caused below changes (please refer to attached dmesg/kmsg for entire
> log/backtrace):
>
>
> 2022-10-28 01:04:44 make quicktest=1 run_tests -C memory-hotplug
> make: Entering directory
> '/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-13023c33c962730a38
> d6b43995910c8805637a9a/tools/testing/selftests/memory-hotplug'
> TAP version 13
> 1..1
> # selftests: memory-hotplug: mem-on-off-test.sh # Test scope: 2% hotplug
> memory
> # online all hot-pluggable memory in offline state:
> # SKIPPED - no hot-pluggable memory in offline state
> # offline 2% hot-pluggable memory in online state
> # trying to offline 5 out of 224 memory block(s):
> # online->offline memory0
> # ./mem-on-off-test.sh: line 78: echo: write error: Invalid argument #
> offline_memory_expect_success 0: unexpected fail # online->offline
> memory1 # online->offline memory10 # online->offline memory100 #
> online->offline memory101 # online->offline memory102
> # online all hot-pluggable memory in offline state:
> # offline->online memory1
> # offline->online memory10
> # offline->online memory100
> # offline->online memory101
> # offline->online memory102
> # Test with memory notifier error injection
> # ./mem-on-off-test.sh: line 267: echo: write error: Invalid argument #

I can not reproduce the error according to the file 'reproduce'.

Line 267 is not runnable on my system. Is there something wrong here?

The code on my system like:

266 #
267 # Offline $ratio percent of hot-pluggable memory
268 #
269 echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
270 for memory in `hotpluggable_online_memory`; do
271 if [ $((RANDOM % 100)) -lt $ratio ]; then
272 offline_memory_expect_success $memory &>/dev/null
273 fi
274 done


> online_memory_expect_fail 142: unexpected success #
> online_memory_expect_fail 190: unexpected success
> # ./mem-on-off-test.sh: line 287: echo: write error: Invalid argument #

The problem is similar with line 267.

> offline_memory_expect_fail 107: unexpected success #

It seems the error-inject not work.

Regards,
Gongyi

2022-11-01 12:03:40

by Zhao Gongyi

[permalink] [raw]
Subject: Re: [linus:master] [selftests/memory] 13023c33c9: kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail

Hi!


>
> Hi!
>
> >
> > Hi Gongyi,
> >
> > We noticed that below commit may change the exit status of
> > memory-hotplug selftest, please check if the test result is expected.
> >
> > We got same test log before this commit but with a good exit, though
> > there were also some "Invalid argument" and "unexpected success" log.
> > Please help give some guidance if there are any problems in our test
> flow.
> > Thanks.
> >
> >
> > Greeting,
> >
> > FYI, we noticed
> > kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail
> > due to commit (built with gcc-11):
> >
> > commit: 13023c33c962730a38d6b43995910c8805637a9a
> > ("selftests/memory-hotplug: Add checking after online or offline")
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
> >
> > in testcase: kernel-selftests
> > version: kernel-selftests-x86_64-9313ba54-1_20221017
> > with following parameters:
> >
> > group: memory-hotplug
> >
> > test-description: The kernel contains a set of "self tests" under the
> > tools/testing/selftests/ directory. These are intended to be small
> > unit tests to exercise individual code paths in the kernel.
> > test-url: https://www.kernel.org/doc/Documentation/kselftest.txt
> >
> >
> > on test machine: 8 threads Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
> > (Skylake) with 28G memory
> >
> > caused below changes (please refer to attached dmesg/kmsg for entire
> > log/backtrace):
> >
> >
> > 2022-10-28 01:04:44 make quicktest=1 run_tests -C memory-hotplug
> > make: Entering directory
> >
> '/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-13023c33c962730a38
> > d6b43995910c8805637a9a/tools/testing/selftests/memory-hotplug'
> > TAP version 13
> > 1..1
> > # selftests: memory-hotplug: mem-on-off-test.sh # Test scope: 2%
> > hotplug memory
> > # online all hot-pluggable memory in offline state:
> > # SKIPPED - no hot-pluggable memory in offline state
> > # offline 2% hot-pluggable memory in online state
> > # trying to offline 5 out of 224 memory block(s):
> > # online->offline memory0
> > # ./mem-on-off-test.sh: line 78: echo: write error: Invalid argument #
> > offline_memory_expect_success 0: unexpected fail # online->offline
> > memory1 # online->offline memory10 # online->offline memory100 #
> > online->offline memory101 # online->offline memory102
> > # online all hot-pluggable memory in offline state:
> > # offline->online memory1
> > # offline->online memory10
> > # offline->online memory100
> > # offline->online memory101
> > # offline->online memory102
> > # Test with memory notifier error injection
> > # ./mem-on-off-test.sh: line 267: echo: write error: Invalid argument
> > #
>
> I can not reproduce the error according to the file 'reproduce'.
>
> Line 267 is not runnable on my system. Is there something wrong here?
>
> The code on my system like:
>
> 266 #
> 267 # Offline $ratio percent of hot-pluggable memory
> 268 #
> 269 echo 0 >
> $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
> 270 for memory in `hotpluggable_online_memory`; do
> 271 if [ $((RANDOM % 100)) -lt $ratio ]; then
> 272 offline_memory_expect_success $memory
> &>/dev/null
> 273 fi
> 274 done
>
>
> > online_memory_expect_fail 142: unexpected success #
> > online_memory_expect_fail 190: unexpected success #
> > ./mem-on-off-test.sh: line 287: echo: write error: Invalid argument #
>
> The problem is similar with line 267.
>
> > offline_memory_expect_fail 107: unexpected success #
>
> It seems the error-inject not work.


Oh, I see that the version you run the test is based on commit 13023c33c962730a38d6b43995910c8805637a9a, and there is a bug on lib/notifier-error-inject.c.

The commit of the fix patch is c597d9054b13.

Your test version has no the fix patch, So the test failed as expected


Regards,
Gongyi

2022-11-03 07:27:34

by kernel test robot

[permalink] [raw]
Subject: Re: [linus:master] [selftests/memory] 13023c33c9: kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail

Hi Gongyi,

On Tue, Nov 01, 2022 at 11:56:40AM +0000, zhaogongyi wrote:
> Hi!
>
>
> >
> > Hi!
> >
> > >
> > > Hi Gongyi,
> > >
> > > We noticed that below commit may change the exit status of
> > > memory-hotplug selftest, please check if the test result is expected.
> > >
> > > We got same test log before this commit but with a good exit, though
> > > there were also some "Invalid argument" and "unexpected success" log.
> > > Please help give some guidance if there are any problems in our test
> > flow.
> > > Thanks.
> > >
> > >
> > > Greeting,
> > >
> > > FYI, we noticed
> > > kernel-selftests.memory-hotplug.mem-on-off-test.sh.fail
> > > due to commit (built with gcc-11):
> > >
> > > commit: 13023c33c962730a38d6b43995910c8805637a9a
> > > ("selftests/memory-hotplug: Add checking after online or offline")
> > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
> > >
> > > in testcase: kernel-selftests
> > > version: kernel-selftests-x86_64-9313ba54-1_20221017
> > > with following parameters:
> > >
> > > group: memory-hotplug
> > >
> > > test-description: The kernel contains a set of "self tests" under the
> > > tools/testing/selftests/ directory. These are intended to be small
> > > unit tests to exercise individual code paths in the kernel.
> > > test-url: https://www.kernel.org/doc/Documentation/kselftest.txt
> > >
> > >
> > > on test machine: 8 threads Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
> > > (Skylake) with 28G memory
> > >
> > > caused below changes (please refer to attached dmesg/kmsg for entire
> > > log/backtrace):
> > >
> > >
> > > 2022-10-28 01:04:44 make quicktest=1 run_tests -C memory-hotplug
> > > make: Entering directory
> > >
> > '/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-13023c33c962730a38
> > > d6b43995910c8805637a9a/tools/testing/selftests/memory-hotplug'
> > > TAP version 13
> > > 1..1
> > > # selftests: memory-hotplug: mem-on-off-test.sh # Test scope: 2%
> > > hotplug memory
> > > # online all hot-pluggable memory in offline state:
> > > # SKIPPED - no hot-pluggable memory in offline state
> > > # offline 2% hot-pluggable memory in online state
> > > # trying to offline 5 out of 224 memory block(s):
> > > # online->offline memory0
> > > # ./mem-on-off-test.sh: line 78: echo: write error: Invalid argument #
> > > offline_memory_expect_success 0: unexpected fail # online->offline
> > > memory1 # online->offline memory10 # online->offline memory100 #
> > > online->offline memory101 # online->offline memory102
> > > # online all hot-pluggable memory in offline state:
> > > # offline->online memory1
> > > # offline->online memory10
> > > # offline->online memory100
> > > # offline->online memory101
> > > # offline->online memory102
> > > # Test with memory notifier error injection
> > > # ./mem-on-off-test.sh: line 267: echo: write error: Invalid argument
> > > #
> >
> > I can not reproduce the error according to the file 'reproduce'.
> >
> > Line 267 is not runnable on my system. Is there something wrong here?
> >
> > The code on my system like:
> >
> > 266 #
> > 267 # Offline $ratio percent of hot-pluggable memory
> > 268 #
> > 269 echo 0 >
> > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
> > 270 for memory in `hotpluggable_online_memory`; do
> > 271 if [ $((RANDOM % 100)) -lt $ratio ]; then
> > 272 offline_memory_expect_success $memory
> > &>/dev/null
> > 273 fi
> > 274 done
> >
> >
> > > online_memory_expect_fail 142: unexpected success #
> > > online_memory_expect_fail 190: unexpected success #
> > > ./mem-on-off-test.sh: line 287: echo: write error: Invalid argument #
> >
> > The problem is similar with line 267.
> >
> > > offline_memory_expect_fail 107: unexpected success #
> >
> > It seems the error-inject not work.
>
>
> Oh, I see that the version you run the test is based on commit 13023c33c962730a38d6b43995910c8805637a9a, and there is a bug on lib/notifier-error-inject.c.
>
> The commit of the fix patch is c597d9054b13.
>
> Your test version has no the fix patch, So the test failed as expected

Thanks for the info. We tested on the fix patch and found that the issue
is gone.

lib/notifier-error-inject: fix error when writing -errno to debugfs file

But seems this fix patch has not been merged to mainline yet. We run
various selftests on mainline regularly, so we caught this issue and it
is still there. Hope the fix will make it to mainline soon. Thanks.

--
Best Regards,
Yujie