Linux cgroups development
 help / color / mirror / Atom feed
From: Noah Feldt <noah@feldt.systems>
To: tj@kernel.org
Cc: carnil@debian.org, cgroups@vger.kernel.org, dschatzberg@meta.com,
	hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
	mkoutny@suse.com, peterz@infradead.org, stable@vger.kernel.org,
	Noah Feldt <noah@feldt.systems>
Subject: Re: [PATCH] cgroup: Avoid iteration of dying tasks with zero refcount
Date: Mon, 07 Sep 2026 15:43:45 +0000	[thread overview]
Message-ID: <20260907154324.91918-1-noah@feldt.systems> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 615 bytes --]

On Wed, Sep 02, 2026 at 08:59:39AM -1000, Tejun Heo wrote:
> How about something like the following? It's more in line with other skips
> and the resulting behavior should remain the same as before:
>
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -5228,6 +5229,21 @@
> +	if (it->task_pos && it->cur_tasks_head == &it->cur_cset->dying_tasks) {
> +		task = list_entry(it->task_pos, struct task_struct, cg_list);
> +		if (!atomic_read(&task->signal->live))
> +			css_task_iter_advance(it);
> +	}

I tested this change and the crash did not happen anymore with the second
PoC I sent.

Thanks,
Noah

[-- Attachment #1.2: publickey - noah@feldt.systems - 0x9B02BBB4.asc --]
[-- Type: application/pgp-keys, Size: 698 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 322 bytes --]

             reply	other threads:[~2026-09-07 15:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 15:43 Noah Feldt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-09-02 16:16 [PATCH] cgroup: Avoid iteration of dying tasks with zero refcount Michal Koutný
2026-09-02 18:59 ` Tejun Heo
2026-09-03 20:07 ` Salvatore Bonaccorso

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=20260907154324.91918-1-noah@feldt.systems \
    --to=noah@feldt.systems \
    --cc=carnil@debian.org \
    --cc=cgroups@vger.kernel.org \
    --cc=dschatzberg@meta.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.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