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

Fail on memcg_usage_in_bytes_test #326

Open
minhhungft9 opened this issue May 31, 2018 · 7 comments
Open

Fail on memcg_usage_in_bytes_test #326

minhhungft9 opened this issue May 31, 2018 · 7 comments

Comments

@minhhungft9
Copy link

minhhungft9 commented May 31, 2018

The test mostly passes but sometimes it gets fail, here is the log:

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: 1583
memcg_usage_in_bytes_test 1 TINFO: Process is still here after warm up: 1583
memcg_usage_in_bytes_test 1 TFAIL: memory.usage_in_bytes is 4325376, 4194304 expected

As you can see, the value of memory.usage_in_bytes (4325376) is bigger than the sum of RSS, CACHE and SWAP in memory.stat (4194304), which is the value the test case is expecting.

As I check in a reliable documentation, the memory.usage_in_bytes doesn't show the exact value of memory (and swap) usage. If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP) value in memory.stat.

I think it's better to use the sum of RSS, CACHE AND SWAP value in memory.stat to check the result of the test, because apparently the accounting of cgroup memory includes disk cache pages which were used by the processes, so the value of memory.usage_in_bytes might be not truthful in this test.

@minhhungft9 minhhungft9 changed the title memory.usage_in_bytes fail memory.usage_in_bytes fail on memcg_usage_in_bytes_test May 31, 2018
@minhhungft9 minhhungft9 changed the title memory.usage_in_bytes fail on memcg_usage_in_bytes_test Fix memory.usage_in_bytes fail on memcg_usage_in_bytes_test May 31, 2018
@minhhungft9 minhhungft9 changed the title Fix memory.usage_in_bytes fail on memcg_usage_in_bytes_test Fail on memcg_usage_in_bytes_test Jun 6, 2018
@pevik
Copy link
Member

pevik commented Jul 4, 2018

I've seen similar issue for memcg_stat_test.

@minhhungft9
Copy link
Author

@pevik have you worked on this case?

@xuyang0410
Copy link
Member

@wangli5665 I met the same problem(my environment was 4.18.0-107.el8.x86_64). I am not sure whether this is a case problem or a kernel design. What do you think about it?

@xuyang0410
Copy link
Member

Does anyone also work on it? This failure seems existed a long time.

@ywangwrs
Copy link

ywangwrs commented Apr 8, 2020

I met the same issue.
From this document: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/memory.html?highlight=memory%20use_hierarchy#hierarchy-support

NOTE1: Enabling/disabling will fail if either the cgroup already has other
cgroups created below it, or if the parent cgroup has use_hierarchy
enabled.

Seems the test case need to check if memory.use_hierarchy can be disabled and then do the setting.
Does anyone work on this issue?

@pevik
Copy link
Member

pevik commented Apr 20, 2020

@xuyang0410 Feel free to work on the issue. IMHO nobody else is working on it.

@ywangwrs
Copy link

Any update on this issue?

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