[Devel] [PATCH v2 RH7 3/3] Revert "sched: Port diff-fairsched-cpuset-add-fake-cpuset-for-containers"

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon May 23 03:25:34 PDT 2016


No need in faking after patch "[PATCH RH7 2/3] proc/cpuset: do not show
cpuset in CT"

This reverts commit 7c57b078d025b71fc14cf4e96cfccb9b4f806834.

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 kernel/cpuset.c | 55 -------------------------------------------------------
 1 file changed, 55 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3e9b806..689428d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -87,9 +87,6 @@ struct cpuset {
 	cpumask_var_t cpus_allowed;	/* CPUs allowed to tasks in cpuset */
 	nodemask_t mems_allowed;	/* Memory Nodes allowed to tasks */
 
-	cpumask_var_t ve_cpus_allowed;
-	nodemask_t ve_mems_allowed;
-
 	struct fmeter fmeter;		/* memory_pressure filter */
 
 	/*
@@ -880,15 +877,6 @@ static int __update_cpumask(struct cpuset *cs,
 	if (cs == &top_cpuset)
 		return -EACCES;
 
-	/*
-	 * If we are in CT use fake cpu mask
-	 * can set and read, but no effect
-	 */
-	if (!ve_is_super(get_exec_env())) {
-		cpumask_copy(cs->ve_cpus_allowed, cpus_allowed);
-		return 0;
-	}
-
 	if (!cpumask_subset(cpus_allowed, cpu_active_mask))
 		return -EINVAL;
 
@@ -1152,16 +1140,6 @@ static int __update_nodemask(struct cpuset *cs,
 		goto done;
 	}
 
-	/*
-	 * If we are in CT use fake node mask
-	 * can set and read, but no effect
-	 */
-	if (!ve_is_super(get_exec_env())) {
-		cs->ve_mems_allowed = *mems_allowed;
-		retval = 0;
-		goto done;
-	}
-
 	if (!nodes_subset(*mems_allowed, node_states[N_MEMORY])) {
 		retval = -EINVAL;
 		goto done;
@@ -1611,9 +1589,6 @@ static int cpuset_write_u64(struct cgroup *cgrp, struct cftype *cft, u64 val)
 	cpuset_filetype_t type = cft->private;
 	int retval = 0;
 
-	if (!ve_is_super(get_exec_env()))
-		return -EACCES;
-
 	mutex_lock(&cpuset_mutex);
 	if (!is_cpuset_online(cs)) {
 		retval = -ENODEV;
@@ -1663,9 +1638,6 @@ static int cpuset_write_s64(struct cgroup *cgrp, struct cftype *cft, s64 val)
 	cpuset_filetype_t type = cft->private;
 	int retval = -ENODEV;
 
-	if (!ve_is_super(get_exec_env()))
-		return -EACCES;
-
 	mutex_lock(&cpuset_mutex);
 	if (!is_cpuset_online(cs))
 		goto out_unlock;
@@ -1747,9 +1719,6 @@ static size_t cpuset_sprintf_cpulist(char *page, struct cpuset *cs)
 {
 	size_t count;
 
-	if (!ve_is_super(get_exec_env()))
-		return cpulist_scnprintf(page, PAGE_SIZE, cs->ve_cpus_allowed);
-
 	mutex_lock(&callback_mutex);
 	count = cpulist_scnprintf(page, PAGE_SIZE, cs->cpus_allowed);
 	mutex_unlock(&callback_mutex);
@@ -1761,9 +1730,6 @@ static size_t cpuset_sprintf_memlist(char *page, struct cpuset *cs)
 {
 	size_t count;
 
-	if (!ve_is_super(get_exec_env()))
-		return nodelist_scnprintf(page, PAGE_SIZE, cs->ve_mems_allowed);
-
 	mutex_lock(&callback_mutex);
 	count = nodelist_scnprintf(page, PAGE_SIZE, cs->mems_allowed);
 	mutex_unlock(&callback_mutex);
@@ -1811,10 +1777,6 @@ static u64 cpuset_read_u64(struct cgroup *cont, struct cftype *cft)
 {
 	struct cpuset *cs = cgroup_cs(cont);
 	cpuset_filetype_t type = cft->private;
-
-	if (!ve_is_super(get_exec_env()))
-		return 0;
-
 	switch (type) {
 	case FILE_CPU_EXCLUSIVE:
 		return is_cpu_exclusive(cs);
@@ -1846,10 +1808,6 @@ static s64 cpuset_read_s64(struct cgroup *cont, struct cftype *cft)
 {
 	struct cpuset *cs = cgroup_cs(cont);
 	cpuset_filetype_t type = cft->private;
-
-	if (!ve_is_super(get_exec_env()))
-		return 0;
-
 	switch (type) {
 	case FILE_SCHED_RELAX_DOMAIN_LEVEL:
 		return cs->relax_domain_level;
@@ -1977,17 +1935,10 @@ static struct cgroup_subsys_state *cpuset_css_alloc(struct cgroup *cont)
 		kfree(cs);
 		return ERR_PTR(-ENOMEM);
 	}
-	if (!alloc_cpumask_var(&cs->ve_cpus_allowed, GFP_KERNEL)) {
-		free_cpumask_var(cs->cpus_allowed);
-		kfree(cs);
-		return ERR_PTR(-ENOMEM);
-	}
 
 	set_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
 	cpumask_clear(cs->cpus_allowed);
 	nodes_clear(cs->mems_allowed);
-	cpumask_clear(cs->ve_cpus_allowed);
-	nodes_clear(cs->ve_mems_allowed);
 	fmeter_init(&cs->fmeter);
 	INIT_WORK(&cs->hotplug_work, cpuset_propagate_hotplug_workfn);
 	cs->relax_domain_level = -1;
@@ -2075,7 +2026,6 @@ static void cpuset_css_free(struct cgroup *cont)
 	struct cpuset *cs = cgroup_cs(cont);
 
 	free_cpumask_var(cs->cpus_allowed);
-	free_cpumask_var(cs->ve_cpus_allowed);
 	kfree(cs);
 }
 
@@ -2105,15 +2055,10 @@ int __init cpuset_init(void)
 
 	if (!alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_KERNEL))
 		BUG();
-	if (!alloc_cpumask_var(&top_cpuset.ve_cpus_allowed, GFP_KERNEL))
-		BUG();
 
 	cpumask_setall(top_cpuset.cpus_allowed);
 	nodes_setall(top_cpuset.mems_allowed);
 
-	cpumask_clear(top_cpuset.ve_cpus_allowed);
-	nodes_clear(top_cpuset.ve_mems_allowed);
-
 	fmeter_init(&top_cpuset.fmeter);
 	set_bit(CS_SCHED_LOAD_BALANCE, &top_cpuset.flags);
 	top_cpuset.relax_domain_level = -1;
-- 
2.5.5



More information about the Devel mailing list