sched/psi: Consolidate cgroup_psi()
authorChengming Zhou <zhouchengming@bytedance.com>
Thu, 25 Aug 2022 16:41:09 +0000 (00:41 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 9 Sep 2022 09:08:33 +0000 (11:08 +0200)
commit57899a6610e67ba26fa3251ebbef4a5ed21efc5d
treecd4fe1689b8e0f4001966dba898bd9e809a86152
parent52b1364ba0b105122d6de0e719b36db705011ac1
sched/psi: Consolidate cgroup_psi()

cgroup_psi() can't return psi_group for root cgroup, so we have many
open code "psi = cgroup_ino(cgrp) == 1 ? &psi_system : cgrp->psi".

This patch move cgroup_psi() definition to <linux/psi.h>, in which
we can return psi_system for root cgroup, so can handle all cgroups.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lore.kernel.org/r/20220825164111.29534-9-zhouchengming@bytedance.com
include/linux/cgroup.h
include/linux/psi.h
kernel/cgroup/cgroup.c