diff options
author | Shakeel Butt <shakeel.butt@linux.dev> | 2025-06-17 12:57:23 -0700 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2025-06-17 10:01:00 -1000 |
commit | 36df6e3dbd7e7b074e55fec080012184e2fa3a46 (patch) | |
tree | 0390e8f547694cc19949b9f96a00a5bc8e8a4bb2 /tools/perf/scripts/python/stat-cpi.py | |
parent | 1257b8786ac689a2ce5fe3e1741c65038035adc6 (diff) |
cgroup: make css_rstat_updated nmi safe
To make css_rstat_updated() able to safely run in nmi context, let's
move the rstat update tree creation at the flush side and use per-cpu
lockless lists in struct cgroup_subsys to track the css whose stats are
updated on that cpu.
The struct cgroup_subsys_state now has per-cpu lnode which needs to be
inserted into the corresponding per-cpu lhead of struct cgroup_subsys.
Since we want the insertion to be nmi safe, there can be multiple
inserters on the same cpu for the same lnode. Here multiple inserters
are from stacked contexts like softirq, hardirq and nmi.
The current llist does not provide function to protect against the
scenario where multiple inserters can use the same lnode. So, using
llist_node() out of the box is not safe for this scenario.
However we can protect against multiple inserters using the same lnode
by using the fact llist node points to itself when not on the llist and
atomically reset it and select the winner as the single inserter.
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Tested-by: JP Kobryn <inwardvessel@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
0 files changed, 0 insertions, 0 deletions