lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200403180801.209970-1-brho@google.com>
Date:   Fri,  3 Apr 2020 14:08:01 -0400
From:   Barret Rhoden <brho@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>
Cc:     linux-kernel@...r.kernel.org, Ian Rogers <irogers@...gle.com>
Subject: perf/cgroup: use the cgroup_id() helper

We had a few places that still used cgrp->kn->id instead of cgroup_id().

Signed-off-by: Barret Rhoden <brho@...gle.com>
---
 kernel/events/core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 318435c5bf0b..e5deab0e7185 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1594,7 +1594,8 @@ perf_event_groups_less(struct perf_event *left, struct perf_event *right)
 			return false;
 		}
 		/* Two dissimilar cgroups, order by id. */
-		if (left->cgrp->css.cgroup->kn->id < right->cgrp->css.cgroup->kn->id)
+		if (cgroup_id(left->cgrp->css.cgroup) <
+		    cgroup_id(right->cgrp->css.cgroup))
 			return true;
 
 		return false;
@@ -1692,7 +1693,7 @@ perf_event_groups_first(struct perf_event_groups *groups, int cpu,
 	u64 node_cgrp_id, cgrp_id = 0;
 
 	if (cgrp)
-		cgrp_id = cgrp->kn->id;
+		cgrp_id = cgroup_id(cgrp);
 #endif
 
 	while (node) {
@@ -1709,7 +1710,7 @@ perf_event_groups_first(struct perf_event_groups *groups, int cpu,
 #ifdef CONFIG_CGROUP_PERF
 		node_cgrp_id = 0;
 		if (node_event->cgrp && node_event->cgrp->css.cgroup)
-			node_cgrp_id = node_event->cgrp->css.cgroup->kn->id;
+			node_cgrp_id = cgroup_id(node_event->cgrp->css.cgroup);
 
 		if (cgrp_id < node_cgrp_id) {
 			node = node->rb_left;
@@ -1745,10 +1746,10 @@ perf_event_groups_next(struct perf_event *event)
 
 #ifdef CONFIG_CGROUP_PERF
 	if (event->cgrp && event->cgrp->css.cgroup)
-		curr_cgrp_id = event->cgrp->css.cgroup->kn->id;
+		curr_cgrp_id = cgroup_id(event->cgrp->css.cgroup);
 
 	if (next->cgrp && next->cgrp->css.cgroup)
-		next_cgrp_id = next->cgrp->css.cgroup->kn->id;
+		next_cgrp_id = cgroup_id(next->cgrp->css.cgroup);
 
 	if (curr_cgrp_id != next_cgrp_id)
 		return NULL;
-- 
2.26.0.292.g33ef6b2f38-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ