[Devel] [PATCH RHEL7 COMMIT] Revert "ve/proc/cpuset: do not show cpuset in CT"

Konstantin Khorenko khorenko at virtuozzo.com
Fri Dec 15 17:04:07 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-693.11.1.vz7.39.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.11.1.vz7.39.6
------>
commit a0ef22f672a20abcdfb2b3eb66731957870a7c8b
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Fri Dec 15 16:56:40 2017 +0300

    Revert "ve/proc/cpuset: do not show cpuset in CT"
    
    This reverts commit 5160bd34c9bda8f246c04b564215f8edaba02f67.
    
    By Pasha Tikhomirov:
    
    The main idea of faking/hiding cpuset was: cpuset is not virtuallized(we don't
    have virtual processors) so container can bind itself to physical cpus and
    memory nodes. If several containers bind to same cpu they will end up competing
    for these cpu resources, it can influence performance badly.
    
    But AFAIKS performance is degraded only for containers which setup cpuset
    badly, all others are still scheduled on all cores and are fine.
    
    So we've decided to just enable back cpuset in CT with no faking.
    
    Problem with these approach is that in case we set --cpus(cpu.nr_cpus) for a
    container, from the inside of the CT one will be able to see real number of
    processors on the host node through /sys/fs/cgroups/cpuset/cpuset.cpus (note:
    we hide real number of host's cpus in CT in /proc/cpuinfo and friends).
    
    We don't wan't to fix it right now, but if someone will come to us with the
    above problem we can also set cpuset.cpus to CT along with cpu.nr_cpus. This
    cpuset range will have length of nr_cpus. Also we would need to spread these
    ranges across cpu cores evenly for different containers (for instance
    randomly), same reason for that - if all containers share same cpu range
    performance will degrade as other cpus are idle.
    
    https://jira.sw.ru/browse/PSBM-30541
    https://jira.sw.ru/browse/PSBM-58423
    
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/cgroup.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 51ce4abdaf02..5c4af09e67f7 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5011,13 +5011,6 @@ static int __init cgroup_wq_init(void)
 }
 core_initcall(cgroup_wq_init);
 
-static int ve_hide_cgroups(struct cgroupfs_root *root)
-{
-	/* Hide cpuset cgroup in CT for docker */
-	return !ve_is_super(get_exec_env())
-	       && (root->subsys_mask & (1UL << cpuset_subsys_id));
-}
-
 /*
  * proc_cgroup_show()
  *  - Print task's cgroup paths into seq_file, one line for each hierarchy
@@ -5059,8 +5052,6 @@ int proc_cgroup_show(struct seq_file *m, void *v)
 		struct cgroup *cgrp;
 		int count = 0;
 
-		if (ve_hide_cgroups(root))
-			continue;
 		seq_printf(m, "%d:", root->hierarchy_id);
 		for_each_subsys(root, ss)
 			seq_printf(m, "%s%s", count++ ? "," : "", ss->name);
@@ -5105,8 +5096,6 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 
 		if (ss == NULL)
 			continue;
-		if (ve_hide_cgroups(ss->root))
-			continue;
 		num = _cg_virtualized(ss->root->number_of_cgroups);
 		seq_printf(m, "%s\t%d\t%d\t%d\n",
 			   ss->name, ss->root->hierarchy_id,


More information about the Devel mailing list