Skip to content

Commit 83c4087

Browse files
committed
Merge branch 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
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
2 parents a67eefa + a90e90b commit 83c4087

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

Documentation/cgroup-v1/rdma.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cgroup.
2727
Currently user space applications can easily take away all the rdma verb
2828
specific resources such as AH, CQ, QP, MR etc. Due to which other applications
2929
in other cgroup or kernel space ULPs may not even get chance to allocate any
30-
rdma resources. This can leads to service unavailability.
30+
rdma resources. This can lead to service unavailability.
3131

3232
Therefore RDMA controller is needed through which resource consumption
3333
of processes can be limited. Through this controller different rdma

include/linux/cgroup.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -569,20 +569,11 @@ static inline bool cgroup_is_descendant(struct cgroup *cgrp,
569569
static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp,
570570
int ancestor_level)
571571
{
572-
struct cgroup *ptr;
573-
574572
if (cgrp->level < ancestor_level)
575573
return NULL;
576-
577-
for (ptr = cgrp;
578-
ptr && ptr->level > ancestor_level;
579-
ptr = cgroup_parent(ptr))
580-
;
581-
582-
if (ptr && ptr->level == ancestor_level)
583-
return ptr;
584-
585-
return NULL;
574+
while (cgrp && cgrp->level > ancestor_level)
575+
cgrp = cgroup_parent(cgrp);
576+
return cgrp;
586577
}
587578

588579
/**

net/core/netclassid_cgroup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft,
106106
iterate_fd(p->files, 0, update_classid_sock,
107107
(void *)(unsigned long)cs->classid);
108108
task_unlock(p);
109+
cond_resched();
109110
}
110111
css_task_iter_end(&it);
111112

0 commit comments

Comments
 (0)