[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170914070357.29288-1-linxiulei@gmail.com>
Date: Thu, 14 Sep 2017 15:03:57 +0800
From: linxiulei@...il.com
To: yang_oliver@...mail.com, peterz@...radead.org, mingo@...hat.com,
acme@...nel.org, alexander.shishkin@...ux.intel.com,
linux-kernel@...r.kernel.org, tglx@...utronix.de,
eranian@...il.com, torvalds@...ux-foundation.org, jolsa@...hat.com
Cc: "leilei.lin" <leilei.lin@...baba-inc.com>
Subject: [PATCH] perf/core: Update cgroup time with descendants
From: "leilei.lin" <leilei.lin@...baba-inc.com>
This fix updating cgroup time when event is being scheduled in
by cgroup descendants
Signed-off-by: leilei.lin <leilei.lin@...baba-inc.com>
---
kernel/events/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 3e691b7..6f6bd1e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -662,7 +662,9 @@ static inline void update_cgrp_time_from_event(struct perf_event *event)
/*
* Do not update time when cgroup is not active
*/
- if (cgrp == event->cgrp)
+ if (cgrp == event->cgrp ||
+ cgroup_is_descendant(cgrp->css.cgroup,
+ event->cgrp->css.cgroup))
__update_cgrp_time(event->cgrp);
}
--
2.8.4.31.g9ed660f
Powered by blists - more mailing lists