Merge branch 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Oct 2018 00:15:46 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Oct 2018 00:15:46 +0000 (17:15 -0700)
Pull cgroup updates from Tejun Heo:
 "All trivial changes - simplification, typo fix and adding
  cond_resched() in a netclassid update loop"

* 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup, netclassid: add a preemption point to write_classid
  rdmacg: fix a typo in rdmacg documentation
  cgroup: Simplify cgroup_ancestor

Documentation/cgroup-v1/rdma.txt
include/linux/cgroup.h
net/core/netclassid_cgroup.c

index af618171e0eb338adc7e8f40eb3c18399c0420b7..9bdb7fd03f838879782d6db6ca96c1c85ad0309f 100644 (file)
@@ -27,7 +27,7 @@ cgroup.
 Currently user space applications can easily take away all the rdma verb
 specific resources such as AH, CQ, QP, MR etc. Due to which other applications
 in other cgroup or kernel space ULPs may not even get chance to allocate any
-rdma resources. This can leads to service unavailability.
+rdma resources. This can lead to service unavailability.
 
 Therefore RDMA controller is needed through which resource consumption
 of processes can be limited. Through this controller different rdma
index b8bcbdeb2eac428609da123c3f410806537ddae3..b622d660860509d266008ebcf75175af7839c496 100644 (file)
@@ -569,20 +569,11 @@ static inline bool cgroup_is_descendant(struct cgroup *cgrp,
 static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp,
                                             int ancestor_level)
 {
-       struct cgroup *ptr;
-
        if (cgrp->level < ancestor_level)
                return NULL;
-
-       for (ptr = cgrp;
-            ptr && ptr->level > ancestor_level;
-            ptr = cgroup_parent(ptr))
-               ;
-
-       if (ptr && ptr->level == ancestor_level)
-               return ptr;
-
-       return NULL;
+       while (cgrp && cgrp->level > ancestor_level)
+               cgrp = cgroup_parent(cgrp);
+       return cgrp;
 }
 
 /**
index 5e4f04004a49a38ba9d8f2535aa293eeab898155..7bf83359861527564087e179760be87498cba600 100644 (file)
@@ -106,6 +106,7 @@ static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft,
                iterate_fd(p->files, 0, update_classid_sock,
                           (void *)(unsigned long)cs->classid);
                task_unlock(p);
+               cond_resched();
        }
        css_task_iter_end(&it);