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

tests/cgroup: check cgroup.max/cgroup.high values #107

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

mihalicyn
Copy link
Member

@mihalicyn mihalicyn force-pushed the cgroup2_limits_memory_test branch from 77d2844 to 1a7db76 Compare March 21, 2024 18:00
simondeziel
simondeziel previously approved these changes Mar 21, 2024
Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but this seemingly random number got me to scratching my head until I converted 512MiB into bytes ;)

Maybe we should use an expression like

MEM_LIMIT_MIB=512
lxc config set c1 -c limits.memory="${MEM_LIMIT_MIB}MiB"

...
[ "$(lxc exec c1 -- cat /sys/fs/cgroup/memory.max)" = $((MEM_LIMIT_MIB * 1024 * 1024)) ]
...

Update: if you do that ^, we should also replace the hardcoded 524288 kB we have elsewhere.

@mihalicyn
Copy link
Member Author

Thanks, fixed!

@mihalicyn
Copy link
Member Author

It is correct, that test is failed:

++ lxc exec c1 -- cat /sys/fs/cgroup/memory.max
+ '[' 536870912 = 536870912 ']'
++ lxc exec c1 -- cat /sys/fs/cgroup/memory.high
+ '[' 483180544 = max ']'

we need to merge canonical/lxd#13192

tests/cgroup Outdated Show resolved Hide resolved
tests/cgroup Outdated Show resolved Hide resolved
@mihalicyn mihalicyn force-pushed the cgroup2_limits_memory_test branch from 71a98f0 to 7728d50 Compare March 21, 2024 18:46
@mihalicyn mihalicyn force-pushed the cgroup2_limits_memory_test branch from 47fdcc6 to 197b5d3 Compare March 22, 2024 09:57
@tomponline tomponline merged commit 21ae9cf into canonical:main Mar 22, 2024
57 of 63 checks passed
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

Successfully merging this pull request may close these issues.

3 participants