Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memcg_function test case numbers error #93

Open
zhuxlproject opened this issue Sep 7, 2016 · 7 comments
Open

memcg_function test case numbers error #93

zhuxlproject opened this issue Sep 7, 2016 · 7 comments

Comments

@zhuxlproject
Copy link

zhuxlproject commented Sep 7, 2016

`
<<<test_start>>>
tag=memcg_function stime=1325378846
cmdline=" memcg_function_test.sh"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
/data/ltp/testcases/bin/memcg_function_test.sh: line 282: [: 18446744073692774399: integer expression expected
memcg_function_test 1 TINFO : Running memcg_process --mmap-anon -s 4096
memcg_function_test 1 TINFO : Warming up pid: 6834
memcg_function_test 1 TINFO : Process is still here after warm up: 6834
memcg_function_test 1 TPASS : rss is 4096 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 2 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 2 TINFO : Running memcg_process --mmap-file -s 4096
memcg_function_test 2 TINFO : Warming up pid: 6852
memcg_function_test 2 TINFO : Process is still here after warm up: 6852
memcg_function_test 2 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 3 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 3 TINFO : Running memcg_process --shm -k 3 -s 4096
memcg_function_test 3 TINFO : Warming up pid: 6870
memcg_function_test 3 TINFO : Process is still here after warm up: 6870
memcg_function_test 3 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 4 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 4 TINFO : Running memcg_process --mmap-anon --mmap-file --shm -s 4096
memcg_function_test 4 TINFO : Warming up pid: 6888
memcg_function_test 4 TINFO : Process is still here after warm up: 6888
memcg_function_test 4 TPASS : rss is 4096 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 5 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 5 TINFO : Running memcg_process --mmap-lock1 -s 4096
memcg_function_test 5 TINFO : Warming up pid: 6905
memcg_function_test 5 TINFO : Process is still here after warm up: 6905
memcg_function_test 5 TPASS : rss is 4096 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 6 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 6 TINFO : Running memcg_process --mmap-anon -s 4096
memcg_function_test 6 TINFO : Warming up pid: 6922
memcg_function_test 6 TINFO : Process is still here after warm up: 6922
memcg_function_test 6 TPASS : rss is 4096 as expected
memcg_function_test 7 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 8 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 8 TINFO : Running memcg_process --mmap-file -s 4096
memcg_function_test 8 TINFO : Warming up pid: 6942
memcg_function_test 8 TINFO : Process is still here after warm up: 6942
memcg_function_test 8 TPASS : rss is 0 as expected
memcg_function_test 9 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 10 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 10 TINFO : Running memcg_process --shm -k 8 -s 4096
memcg_function_test 10 TINFO : Warming up pid: 6962
memcg_function_test 10 TINFO : Process is still here after warm up: 6962
memcg_function_test 10 TPASS : rss is 0 as expected
memcg_function_test 11 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 12 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 12 TINFO : Running memcg_process --mmap-anon --mmap-file --shm -s 4096
memcg_function_test 12 TINFO : Warming up pid: 6982
memcg_function_test 12 TINFO : Process is still here after warm up: 6982
memcg_function_test 12 TPASS : rss is 4096 as expected
memcg_function_test 13 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 14 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 14 TINFO : Running memcg_process --mmap-lock1 -s 4096
memcg_function_test 14 TINFO : Warming up pid: 7002
memcg_function_test 14 TINFO : Process is still here after warm up: 7002
memcg_function_test 14 TPASS : rss is 4096 as expected
memcg_function_test 15 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 16 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 16 TINFO : Running memcg_process --mmap-anon -s 8192
/data/ltp/testcases/bin/memcg_lib.sh: line 185: 7022 Killed memcg_process $1 -s $2
memcg_function_test 16 TPASS : memory.failcnt is 9, > 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 17 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 17 TINFO : Running memcg_process --mmap-file -s 8192
/data/ltp/testcases/bin/memcg_lib.sh: line 185: 7035 Killed memcg_process $1 -s $2
memcg_function_test 17 TPASS : memory.failcnt is 9, > 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 18 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 18 TINFO : Running memcg_process --shm -s 8192
/data/ltp/testcases/bin/memcg_lib.sh: line 185: 7049 Killed memcg_process $1 -s $2
memcg_function_test 18 TPASS : memory.failcnt is 9, > 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 19 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 248: 7062 Killed memcg_process $2 -s $3
memcg_function_test 19 TPASS : process 7062 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 20 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 20 TFAIL : Failed to lock memory
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 21 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 248: 7085 Killed memcg_process $2 -s $3
memcg_function_test 21 TPASS : process 7085 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 22 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 248: 7098 Killed memcg_process $2 -s $3
memcg_function_test 22 TPASS : process 7098 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 23 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 248: 7111 Killed memcg_process $2 -s $3
memcg_function_test 23 TPASS : process 7111 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 24 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 248: 7123 Killed memcg_process $2 -s $3
memcg_function_test 24 TPASS : process 7123 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 25 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 237: 7134 Segmentation fault memcg_process $2 -s $3
memcg_function_test 25 TPASS : process 7134 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 26 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/memcg_lib.sh: line 248: 7147 Killed memcg_process $2 -s $3
memcg_function_test 26 TPASS : process 7147 is killed
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 27 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 27 TPASS : input=4095, limit_in_bytes=4096
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 28 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 28 TPASS : input=4097, limit_in_bytes=8192
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 29 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 29 TPASS : input=1, limit_in_bytes=4096
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 30 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 30 TPASS : echo -1 > memory.limit_in_bytes passed as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 31 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 31 TPASS : echo 1.0 > memory.limit_in_bytes failed as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 32 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 32 TPASS : echo 1xx > memory.limit_in_bytes failed as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 33 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 33 TPASS : echo xx > memory.limit_in_bytes failed as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 34 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/test.sh: line 249: echo: write error: Invalid argument
memcg_function_test 34 TFAIL : echo 1 > memory.force_empty failed unexpectedly
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 35 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 35 TPASS : echo 1 > memory.force_empty failed as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 36 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/test.sh: line 249: echo: write error: Invalid argument
memcg_function_test 36 TFAIL : echo 0 > memory.force_empty failed unexpectedly
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 37 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/test.sh: line 249: echo: write error: Invalid argument
memcg_function_test 37 TFAIL : echo 1.0 > memory.force_empty failed unexpectedly
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 38 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/test.sh: line 249: echo: write error: Invalid argument
memcg_function_test 38 TFAIL : echo 1xx > memory.force_empty failed unexpectedly
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 39 TINFO : restore /dev/memcg/memory.use_hierarchy failed
/data/ltp/testcases/bin/test.sh: line 249: echo: write error: Invalid argument
memcg_function_test 39 TFAIL : echo xx > memory.force_empty failed unexpectedly
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 40 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 40 TPASS : echo 1 > /dev/memcg/memory.force_empty failed as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 41 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 41 TINFO : Running memcg_process --mmap-anon -s 4096
memcg_function_test 41 TINFO : Warming up pid: 7281
memcg_function_test 41 TINFO : Process is still here after warm up: 7281
memcg_function_test 41 TPASS : rss is 4096 as expected
memcg_function_test 42 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 43 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 43 TINFO : Running memcg_process --mmap-anon -s 4096
memcg_function_test 43 TINFO : Warming up pid: 7303
memcg_function_test 43 TINFO : Process is still here after warm up: 7303
memcg_function_test 43 TPASS : rss is 4096 as expected
memcg_function_test 44 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 45 TINFO : restore /dev/memcg/memory.use_hierarchy failed
memcg_function_test 45 TINFO : Running memcg_process --mmap-anon -s 4096
memcg_function_test 45 TINFO : Warming up pid: 7325
memcg_function_test 45 TINFO : Process is still here after warm up: 7325
memcg_function_test 45 TPASS : rss is 4096 as expected
memcg_function_test 46 TPASS : rss is 0 as expected
/data/ltp/testcases/bin/memcg_lib.sh: line 428: echo: write error: Device or resource busy
memcg_function_test 47 TINFO : restore /dev/memcg/memory.use_hierarchy failed
<<<execution_status>>>
initiation_status="ok"
duration=78 termination_type=exited termination_id=1 corefile=no
cutime=122 cstime=565
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20160510

   ###############################################################

        Done executing testcases.
        LTP Version:  20160510
   ###############################################################

`

memcg_function_test.sh total_case=38, but show 47 above.

By debug, I find into tst_resm funcion two times, so as follow:
memcg_function_test 6 TPASS : rss is 4096 as expected
memcg_function_test 7 TPASS : rss is 0 as expected
At this time, TST_COUNT add two times, lead to number error.

@metan-ucw
Copy link
Member

First of all the integer expression expected is harmless. The test tries to assert that /proc/sys/kernel/shmmax is large enough and the limit overflows the shell [ ... -lt ... ] test. We can fix that later by using integer context $(()) for the comparison later.

Then to the failures to write to the /dev/memcg/memory.use_hierarchy. This looks like a kernel bug to me . I can reproduce these with kernel 4.4. These failures are caused by tests that preceded the memcg_function_test.sh and works with cgroups. It looks that once any subgroup of the root cgroup has been charged you cannot change the use_hierarchy at all even when all the subgroups were removed. This was working fine with just a bit older kernels.

What distribution and kernel version were you running the testcases on?

@zhuxlproject
Copy link
Author

root@ltp:/data/ltp # uname -a
Linux 3.18.12+ #11 SMP PREEMPT Wed Aug 31 11:03:03 CST 2016 aarch64 GNU/Linux

root@ltp:/data/ltp # cat Version
20160510

@metan-ucw
Copy link
Member

metan-ucw commented Sep 22, 2016

I've talked to kernel devs and this seems to be the result of b2052564e66d ("mm: memcontrol: continue cache reclaim from offlined groups"). Since that commit the charge from deleted subgroups is not moved to the parent but stays accounted for. Side effect is that the memory.use_hierarchy of the root cgroup cannot be changed once there was some memory charged to a subgroup even if there are no processes left in the subgroup and the subgroup itself has been removed. I was told to try to drop caches before writing to the use_hieararchy knob, but that does not seem to help.

You can workaround that for now by setting the memory.use_hierarchy of the root cgroup to 0 after the machine is booted up. I will try to figure out a better solution meanwhile.

@ghost
Copy link

ghost commented Apr 25, 2017

Hi @metan-ucw ,

I sometimes meet this similiar issue. My kernel is 3.14. LTP is latest version.
Can I ask if the workaround that you said (setting the memory.use_hierarchy of the root cgroup to 0) is implemented ?

# uname -a
Linux mx6q 3.14.79-vm0-00625-gd4ae78b4dc91 #1 SMP PREEMPT Wed Apr 19 22:20:54 CEST 2017 armv7l GNU/Linux

2017-03-21T15:19:12 Test: memcg_usage_in_bytes Testparm: memcg_usage_in_bytes_test.sh
memcg_usage_in_bytes_test 1 TINFO: Starting test 1
memcg_usage_in_bytes_test 1 TINFO: Running memcg_process --mmap-anon -s 4194304
memcg_usage_in_bytes_test 1 TINFO: Warming up pid: 886
memcg_usage_in_bytes_test 1 TINFO: Process is still here after warm up: 886
memcg_usage_in_bytes_test 1 TPASS: memory.usage_in_bytes is 4194304 as expected
/opt/ltp/testcases/bin/memcg_lib.sh: line 477: echo: write error: Device or resource busy
memcg_usage_in_bytes_test 2 TINFO: restore  /dev/memcg/memory.use_hierarchy failed
memcg_usage_in_bytes_test 2 TINFO: Starting test 2
memcg_usage_in_bytes_test 2 TINFO: Running memcg_process --mmap-anon -s 4194304
memcg_usage_in_bytes_test 2 TINFO: Warming up pid: 906
memcg_usage_in_bytes_test 2 TINFO: Process is still here after warm up: 906
memcg_usage_in_bytes_test 2 TFAIL: memory.memsw.usage_in_bytes is 4325376, 4194304 expected

@pevik
Copy link
Member

pevik commented Jul 4, 2018

@Vertigo0709 your problem has been later reported as #326.

@JasonXing
Copy link

Until now, it seems that this issue has remained in the 4.19 version kernel and the latest ltp. I've encountered the same TFAIL because of writting 0 into /dev/memcg/memory.use_hierarchy file.
Does anyone still work on it ?

@JasonXing
Copy link

JasonXing commented Jan 15, 2019

In the 4.19.10 kernel, we TFAIL four related testcases:

  1. memcg_max_usage_in_bytes memcg_max_usage_in_bytes_test.sh
  2. memcg_stat memcg_stat_test.sh
  3. memcg_use_hierarchy memcg_use_hierarchy_test.sh
  4. memcg_usage_in_bytes memcg_usage_in_bytes_test.sh

They have the same ERRORS:
"memcg_lib.sh: line 522: echo: write error: Device or resource busy"

pevik pushed a commit that referenced this issue Feb 26, 2021
f0b9d18 increased the memory used by a lot of
memcg tests to 33*pagesize, because some counters in
memory.stat are only updated in batches of 32.
With kernel commit 766a4c19d (v5.3-rc1) this batching is
also applied to some more counters.

Use 33 * pagesize for all test now should make them pass
before and after this commit.

Fixes: #780
This should also fix part of #93 and #783.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Joerg Vehlow <joerg.vehlow@aox-tech.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants