Skip to contentSkip to conversation

https://github.com/raspberrypi/linux/issues/6631

PATCH In review Umar Pathan 3 participants 3 messages Feb 1, 2025 – Feb 11, 2025 cgroup

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 https://github.com/raspberrypi/linux/issues/6631

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")
---
 kernel/cgroup/freezer.c | 1 +
 1 file changed, 1 insertion(+)
kernel/cgroup/freezer.c +1 -0
index e9c15fbe5d9b..d384df2f53c2 100644
@@ -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);
 		}
 
Signature · 1 line
2.47.1
#1 lore raw
Quoted 24 lines · Umar Pathan

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")
---
 kernel/cgroup/freezer.c | 1 +
 1 file changed, 1 insertion(+)
kernel/cgroup/freezer.c +0 -0
index e9c15fbe5d9b..d384df2f53c2 100644

kernel/cgroup/freezer.c void cgroup_freeze(struct cgroup *cgrp, bool freeze) · line 309

Quoted 6 lines
kernel/cgroup/freezer.c +1 -0
@@ -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);
 		}

Hey Umar,

I dug around Github and I think I found the patch you intended to submit
https://github.com/raspberrypi/linux/pull/6632/commits/711f76376ae7e11f48a1c22a4a04828a24d6a87a

Unfortunately, your email only contains the inverse of your PR's whitespace change removing a line in freezer.c, not the rest of the patch. Did you perhaps revert that whitespace change in a new commit and accidentally only submit that commit instead of the whole change?

Thanks,
David Reaver

maintainer
#2 lore raw

Hello both.

Quoted 2 lines · David Reaver

I dug around Github and I think I found the patch you intended to submit
https://github.com/raspberrypi/linux/pull/6632/commits/711f76376ae7e11f48a1c22a4a04828a24d6a87a

Heh, thanks.

Quoted 4 lines

Unfortunately, your email only contains the inverse of your PR's whitespace change removing a line in freezer.c, not the rest of the patch. Did you perhaps revert that whitespace change in a new commit and accidentally only submit that commit instead of the whole change?

There was little freezing counting rework in v6.13. If you can still reproduce the issue, it'd be something to look into. (I'm not sure about interpretation of the direct/propagate freezing in the reproduction steps, if there were sample commands, it'd be nice.)

Thanks,
Michal