From 8839f9f70bc68784020dd3efa6301bf7279b566b Mon Sep 17 00:00:00 2001 From: rajasec Date: Mon, 9 May 2016 20:44:29 +0530 Subject: [PATCH] Adding kernel mem tcp for update command Signed-off-by: rajasec Adding kernel mem tcp for update command Signed-off-by: rajasec Fixing update.bats to reduce the TCP value Signed-off-by: rajasec Updated the kernelTCP in bats as per json Signed-off-by: rajasec Fixed some minor issue in bats file Signed-off-by: rajasec Rounded off to right bytes for kernel TCP Signed-off-by: rajasec Updating man file for update command Signed-off-by: rajasec --- man/runc-update.8.md | 6 ++++-- tests/integration/update.bats | 20 ++++++++++++++++---- update.go | 7 +++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/man/runc-update.8.md b/man/runc-update.8.md index abe2bee59..e4cb10382 100644 --- a/man/runc-update.8.md +++ b/man/runc-update.8.md @@ -13,7 +13,8 @@ accepted format is as follow (unchanged values can be omitted): "limit": 0, "reservation": 0, "swap": 0, - "kernel": 0 + "kernel": 0, + "kernelTCP": 0 }, "cpu": { "shares": 0, @@ -38,7 +39,8 @@ other options are ignored. --cpu-share CPU shares (relative weight vs. other containers) --cpuset-cpus CPU(s) to use --cpuset-mems Memory node(s) to use - --kernel-memory Kernel memory limit (in bytes) for tcp buffer + --kernel-memory Kernel memory limit (in bytes) + --kernel-memory-tcp Kernel memory limit (in bytes) for tcp buffer --memory Memory limit (in bytes) --memory-reservation Memory reservation or soft_limit (in bytes) --memory-swap Total memory usage (memory + swap); set `-1` to enable unlimited swap diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 9bda96fcc..036aa6080 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -34,7 +34,8 @@ function setup() { "memory": { "limit": 33554432, "reservation": 25165824, - "kernel": 16777216 + "kernel": 16777216, + "kernelTCP": 11534336 }, "cpu": { "shares": 100, @@ -75,6 +76,7 @@ function check_cgroup_value() { check_cgroup_value $CGROUP_CPU "cpu.shares" 100 check_cgroup_value $CGROUP_CPUSET "cpuset.cpus" 0 check_cgroup_value $CGROUP_MEMORY "memory.kmem.limit_in_bytes" 16777216 + check_cgroup_value $CGROUP_MEMORY "memory.kmem.tcp.limit_in_bytes" 11534336 check_cgroup_value $CGROUP_MEMORY "memory.limit_in_bytes" 33554432 check_cgroup_value $CGROUP_MEMORY "memory.soft_limit_in_bytes" 25165824 @@ -128,13 +130,19 @@ function check_cgroup_value() { [ "$status" -eq 0 ] check_cgroup_value $CGROUP_MEMORY "memory.kmem.limit_in_bytes" 50331648 + # update kernel memory tcp limit + run "$RUNC" --root $UPDATE_TEST_RUNC_ROOT update test_update --kernel-memory-tcp 41943040 + [ "$status" -eq 0 ] + check_cgroup_value $CGROUP_MEMORY "memory.kmem.tcp.limit_in_bytes" 41943040 + # Revert to the test initial value via json on stding run "$RUNC" --root $UPDATE_TEST_RUNC_ROOT update -r - test_update <