mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Waiman Long <longman@redhat.com>
Cc: "Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH-cgroup v2] cgroup/rstat: Improve cgroup_rstat_push_children() documentation
Date: Fri, 25 Apr 2025 09:45:58 -1000	[thread overview]
Message-ID: <aAvmdg6T_g5s73cR@slm.duckdns.org> (raw)
In-Reply-To: <20250425031656.790645-1-longman@redhat.com>

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@redhat.com>

Applied to cgroup/for-6.16.

Thanks.

-- 
tejun

      reply	other threads:[~2025-04-25 19:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25  3:16 Waiman Long
2025-04-25 19:45 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aAvmdg6T_g5s73cR@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mkoutny@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®