[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aAvmdg6T_g5s73cR@slm.duckdns.org>
Date: Fri, 25 Apr 2025 09:45:58 -1000
From: Tejun Heo <tj@...nel.org>
To: Waiman Long <longman@...hat.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH-cgroup v2] cgroup/rstat: Improve
cgroup_rstat_push_children() documentation
On Thu, Apr 24, 2025 at 11:16:55PM -0400, Waiman Long wrote:
> The cgroup_rstat_push_children() function converts a set of
> updated_children lists from different cgroups into a single ordered
> list of cgroups to be flushed via the rstat_flush_next pointer.
> The algorithm used isn't that well illustrated and it takes time to
> grasp what it is doing. Improve the embedded documentation and variable
> names to better illustrate the transformation process and make the code
> easier to understand.
>
> Also cgroup_rstat_lock must be held for the whole duration
> from where the rstat_flush_next list is being constructed in
> cgroup_rstat_push_children() to when it is consumed later in
> css_rstat_flush(). Otherwise, list corruption can happen leading to
> system crash as reported in [1]. In this particular case, the branch
> being used has commit 093c8812de2d ("cgroup: rstat: Cleanup flushing
> functions and locking") which breaks this rule, but is missing the fix
> commit 7d6c63c31914 ("cgroup: rstat: call cgroup_rstat_updated_list
> with cgroup_rstat_lock") that fixes it.
>
> This patch has no functional change.
>
> [1] https://lore.kernel.org/lkml/BY5PR04MB68495E9E8A46CA9614D62669BCBB2@BY5PR04MB6849.namprd04.prod.outlook.com/
>
> Signed-off-by: Waiman Long <longman@...hat.com>
Applied to cgroup/for-6.16.
Thanks.
--
tejun
Powered by blists - more mailing lists