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
| ||
|
Date: Tue, 22 Mar 2022 20:08:32 +0800 From: Chengming Zhou <zhouchengming@...edance.com> To: peterz@...radead.org, mingo@...hat.com, acme@...nel.org, mark.rutland@....com, alexander.shishkin@...ux.intel.com, jolsa@...nel.org, namhyung@...nel.org, eranian@...gle.com Cc: linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org, duanxiongchun@...edance.com, songmuchun@...edance.com, Chengming Zhou <zhouchengming@...edance.com> Subject: [PATCH v2 4/6] perf/core: Use stable cpuctx->cgrp when update perf cgroup time The current code use the changeable task->cgroups when update the perf cgroup time, which maybe not the active perf_cgroup that sched_in on the CPU. This patch change to use the stable cpuctx->cgrp and only update time when event is matched with cpuctx->cgrp. Signed-off-by: Chengming Zhou <zhouchengming@...edance.com> --- kernel/events/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index e27c06628bad..849a81299906 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -780,7 +780,6 @@ static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx, static inline void update_cgrp_time_from_event(struct perf_event *event) { struct perf_cgroup_info *info; - struct perf_cgroup *cgrp; /* * ensure we access cgroup data only when needed and @@ -789,11 +788,10 @@ static inline void update_cgrp_time_from_event(struct perf_event *event) if (!is_cgroup_event(event)) return; - cgrp = perf_cgroup_from_task(current, event->ctx); /* - * Do not update time when cgroup is not active + * Only update time when event is matched with cpuctx cgrp */ - if (cgroup_is_descendant(cgrp->css.cgroup, event->cgrp->css.cgroup)) { + if (perf_cgroup_match(event)) { info = this_cpu_ptr(event->cgrp->info); __update_cgrp_time(info, perf_clock(), true); } -- 2.20.1
Powered by blists - more mailing lists