* [PATCH] cgroup: remove redundant assignment in while loop of cgroup_calc_subtree_ss_mask()
@ 2019-07-22 11:39 Peng Wang
0 siblings, 0 replies; only message in thread
From: Peng Wang @ 2019-07-22 11:39 UTC (permalink / raw)
To: tj, lizefan, hannes; +Cc: cgroups, linux-kernel, Peng Wang
new_ss_mask is always not less than cur_ss_mask.
We don not need to update it with cur_ss_mask's value.
Signed-off-by: Peng Wang <rocking@whu.edu.cn>
---
kernel/cgroup/cgroup.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 300b0c416341..2b8c39dabd26 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1520,7 +1520,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft)
*/
static u16 cgroup_calc_subtree_ss_mask(u16 subtree_control, u16 this_ss_mask)
{
- u16 cur_ss_mask = subtree_control;
+ u16 cur_ss_mask = subtree_control, new_ss_mask;
struct cgroup_subsys *ss;
int ssid;
@@ -1528,9 +1528,8 @@ static u16 cgroup_calc_subtree_ss_mask(u16 subtree_control, u16 this_ss_mask)
cur_ss_mask |= cgrp_dfl_implicit_ss_mask;
+ new_ss_mask = cur_ss_mask;
while (true) {
- u16 new_ss_mask = cur_ss_mask;
-
do_each_subsys_mask(ss, ssid, cur_ss_mask) {
new_ss_mask |= ss->depends_on;
} while_each_subsys_mask();
--
2.19.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-22 11:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 11:39 [PATCH] cgroup: remove redundant assignment in while loop of cgroup_calc_subtree_ss_mask() Peng Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).