[RHEL7,COMMIT] ve/cgroup: remove rcu_read_lock from cgroup_get_ve_root

Submitted by Konstantin Khorenko on Nov. 7, 2017, 9:06 a.m.

Details

Message ID 201711070906.vA796J3R023098@finist_ce7.work
State New
Series "ve: properly handle nr_cpus and cpu_rate for nested cgroups"
Headers show

Commit Message

Konstantin Khorenko Nov. 7, 2017, 9:06 a.m.
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.21
------>
commit f8168436b4eb925096fe7f14bfc18b0789aa6b3c
Author: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Date:   Tue Nov 7 12:06:19 2017 +0300

    ve/cgroup: remove rcu_read_lock from cgroup_get_ve_root
    
    It is likely a leftover from __cgroup_path where it protects cgrp->name
    in cgroup_get_ve_root there is nothing rcu_dereferenced, also in
    cgroup_is_descendant there is no rcu for cgrp->parent.
    
    https://jira.sw.ru/browse/PSBM-69678
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 kernel/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f960c34..06863de 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4284,7 +4284,6 @@  static struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
 {
 	struct cgroup *ve_root = NULL;
 
-	rcu_read_lock();
 	do {
 		if (test_bit(CGRP_VE_ROOT, &cgrp->flags)) {
 			ve_root = cgrp;
@@ -4292,7 +4291,6 @@  static struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
 		}
 		cgrp = cgrp->parent;
 	} while (cgrp);
-	rcu_read_unlock();
 
 	return ve_root;
 }