public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Umar Pathan <cynexium@gmail.com>
To: tj@kernel.org
Cc: lizefan.x@bytedance.com, hannes@cmpxchg.org,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	Umar Pathan <cynexium@proton.me>
Subject: [PATCH cgroup] https://github.com/raspberrypi/linux/issues/6631
Date: Sat,  1 Feb 2025 09:51:45 +0000	[thread overview]
Message-ID: <20250201095145.32300-1-cynexium@proton.me> (raw)

The existing freezer propagation logic improperly reduces
nr_frozen_descendants by an increasing 'desc' counter during unfreeze,
leading to:
- Premature parent cgroup unfreezing
- Negative descendant counts
- Broken hierarchy state consistency

Scenario demonstrating the bug:
1. Create hierarchy A->B->C
2. Freeze C (A/B freeze via propagation)
3. Freeze A->D (separate branch)
4. Unfreeze C -> A incorrectly unfreezes despite frozen D

Fixes: 711f763 ("freezer,cgroup: add freezer.stats subsystem")
Signed-off-by: Umar cynexium@gmail.com
---
 kernel/cgroup/freezer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/freezer.c b/kernel/cgroup/freezer.c
index e9c15fbe5d9b..d384df2f53c2 100644
--- a/kernel/cgroup/freezer.c
+++ b/kernel/cgroup/freezer.c
@@ -304,6 +304,7 @@ void cgroup_freeze(struct cgroup *cgrp, bool freeze)
 			 */
 			if (dsct->freezer.e_freeze > 0)
 				continue;
+			
 			WARN_ON_ONCE(dsct->freezer.e_freeze < 0);
 		}
 
-- 
2.47.1


             reply	other threads:[~2025-02-01  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-01  9:51 Umar Pathan [this message]
2025-02-01 14:08 ` [PATCH cgroup] https://github.com/raspberrypi/linux/issues/6631 David Reaver
2025-02-11 14:09   ` Michal Koutný

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=20250201095145.32300-1-cynexium@proton.me \
    --to=cynexium@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=cynexium@proton.me \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --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