Linux cgroups development
 help / color / mirror / Atom feed
From: "Michal Koutný" <mkoutny@suse.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: cgroups@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	 Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] cgroup: Move cgrp_dead_ task+iwork into its own struct
Date: Fri, 11 Sep 2026 15:38:01 +0200	[thread overview]
Message-ID: <aqQEDRSoZDnsCTC1@localhost.localdomain> (raw)
In-Reply-To: <20260911101900.984420-1-bigeasy@linutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]

On Fri, Sep 11, 2026 at 12:19:00PM +0200, Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> cgrp_dead_tasks and cgrp_dead_tasks_iwork are independent per-CPU
> variables and are independently accessed via a this_cpu_ptr().
> 
> Having a custom struct with those two members makes it possible to have
> only one per-CPU accessor and access the second member via an offset.
> This makes the code a bit more compact and is micro-optimization.
> 
> Besides that, it allows cgrp_dead_tasks_iwork_fn() to access the list
> pointer via the passed iwork pointer. This not only eliminates the
> this_cpu_ptr() but also makes it possible to be invoked on a different
> CPU. This does not happen as of today but might if I can flush the
> irq_work items from another CPU during CPU-hotplug events.
> 
> Create struct cgroup_dead with the per-CPU variables as members. Access
> the struct with a per-CPU accessor and use the cointer_of() in the
> irq_work callback.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  kernel/cgroup/cgroup.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)

Acked-by: Michal Koutný <mkoutny@suse.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]

  reply	other threads:[~2026-09-11 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 10:19 [PATCH] cgroup: Move cgrp_dead_ task+iwork into its own struct Sebastian Andrzej Siewior
2026-09-11 13:38 ` Michal Koutný [this message]
2026-09-11 14:51 ` Tejun Heo

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=aqQEDRSoZDnsCTC1@localhost.localdomain \
    --to=mkoutny@suse.com \
    --cc=bigeasy@linutronix.de \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=tj@kernel.org \
    /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