diff options
| author | Chengming Zhou <[email protected]> | 2022-08-26 00:41:10 +0800 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2022-09-09 11:08:33 +0200 |
| commit | dc86aba751e2867244411adda1562f6664747019 (patch) | |
| tree | a3da212be6c190b5585ee4f9761c4177ad4f19c6 /include/linux | |
| parent | 57899a6610e67ba26fa3251ebbef4a5ed21efc5d (diff) | |
sched/psi: Cache parent psi_group to speed up group iteration
We use iterate_groups() to iterate each level psi_group to update
PSI stats, which is a very hot path.
In current code, iterate_groups() have to use multiple branches and
cgroup_parent() to get parent psi_group for each level, which is not
very efficient.
This patch cache parent psi_group in struct psi_group, only need to get
psi_group of task itself first, then just use group->parent to iterate.
Signed-off-by: Chengming Zhou <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/psi_types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h index 40c28171cd91..a0b746258c68 100644 --- a/include/linux/psi_types.h +++ b/include/linux/psi_types.h @@ -151,6 +151,8 @@ struct psi_trigger { }; struct psi_group { + struct psi_group *parent; + /* Protects data used by the aggregator */ struct mutex avgs_lock; |