[Devel] [PATCH rh7] sched/core/cfs: don't reset nr_cpus while setting cpu limits

Andrey Ryabinin aryabinin at virtuozzo.com
Tue Jun 7 06:50:38 PDT 2016


Setting cpu limits reset number of cpus
    # echo 2 >/sys/fs/cgroup/cpu,cpuacct/101/cpu.nr_cpus
    # exec 101 cat /proc/cpuinfo |grep -c processor
     2
    # echo 160000 >/sys/fs/cgroup/cpu,cpuacct/101/cpu.cfs_quota_us
    # vzctl exec 101 cat /proc/cpuinfo |grep -c processor
     4
    # cat /sys/fs/cgroup/cpu,cpuacct/101/cpu.nr_cpus
     0

tg_update_cpu_limit() does that without any apparent reason,
so let's fix it,.

https://jira.sw.ru/browse/PSBM-48061

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/sched/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2c147c8..51ebed2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8696,7 +8696,6 @@ static void tg_update_cpu_limit(struct task_group *tg)
 	}
 
 	tg->cpu_rate = rate;
-	tg->nr_cpus = 0;
 }
 
 static int tg_set_cpu_limit(struct task_group *tg,
-- 
2.7.3



More information about the Devel mailing list