Skip to content

Commit 6fb8054

Browse files
donettom-1rata
authored andcommitted
tests/int/cgroups: Use 64K aligned limits for memory.max
When a non–page-aligned value is written to memory.max, the kernel aligns it down to the nearest page boundary. On systems with a page size greater than 4K (e.g., 64K), this caused failures because the configured memory.max value was not 64K aligned. This patch fixes the issue by explicitly aligning the memory.max value to 64K. Since 64K is also a multiple of 4K, the value is correctly aligned on both 4K and 64K page size systems. However, this approach will still fail on systems where the hardcoded memory.max value is not aligned to the system page size. Fixes: #4841 Signed-off-by: Vishal Chourasia <[email protected]> Signed-off-by: Donet Tom <[email protected]> (cherry picked from commit 830c479) Signed-off-by: Rodrigo Campos <[email protected]>
1 parent 799d52d commit 6fb8054

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration/cgroups.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ convert_hugetlb_size() {
337337

338338
set_cgroups_path
339339
update_config ' .linux.resources.unified |= {
340-
"memory.max": "20484096",
340+
"memory.max": "20512768",
341341
"memory.swap.max": "20971520"
342342
}'
343343

@@ -348,10 +348,10 @@ convert_hugetlb_size() {
348348
[ "$status" -eq 0 ]
349349
echo "$output"
350350

351-
echo "$output" | grep -q '^memory.max:20484096$'
351+
echo "$output" | grep -q '^memory.max:20512768$'
352352
echo "$output" | grep -q '^memory.swap.max:20971520$'
353353

354-
check_systemd_value "MemoryMax" 20484096
354+
check_systemd_value "MemoryMax" 20512768
355355
check_systemd_value "MemorySwapMax" 20971520
356356
}
357357

0 commit comments

Comments
 (0)