Re: [PATCH] cgroup: minor cleanup for cgroup_local_stat_show()

From: Johannes Weiner
Date: Thu Aug 03 2023 - 10:28:22 EST


On Thu, Aug 03, 2023 at 07:31:23PM +0800, Miaohe Lin wrote:
> Make it under CONFIG_CGROUP_SCHED to rid of __maybe_unused annotation.
> Also put cgroup_tryget_css() inside CONFIG_CGROUP_SCHED as it's only
> called when CONFIG_CGROUP_SCHED. No functional change intended.
>
> Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>

Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>

> @@ -3686,8 +3686,9 @@ static int cpu_stat_show(struct seq_file *seq, void *v)
> return ret;
> }
>
> -static int __maybe_unused cgroup_local_stat_show(struct seq_file *seq,
> - struct cgroup *cgrp, int ssid)
> +#ifdef CONFIG_CGROUP_SCHED
> +static int cgroup_local_stat_show(struct seq_file *seq,
> + struct cgroup *cgrp, int ssid)

Andrew, this is based on "sched: add throttled time stat for throttled
children" in -next (coming in from -tip). Hence the routing through
you rather than the cgroup tree.