Skip to contentSkip to conversation

cgroup: rstat: call cgroup_rstat_updated_list with cgroup_rstat_lock

PATCH Applied Shakeel Butt 4 participants 4 messages Apr 1, 2025 – Apr 2, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: rstat: call cgroup_rstat_updated_list with cgroup_rstat_lock

The commit 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking") during cleanup accidentally changed the code to call cgroup_rstat_updated_list() without cgroup_rstat_lock which is required. Fix it.

Fixes 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking")
---
 kernel/cgroup/rstat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/cgroup/rstat.c +2 -1
index 4bb587d5d34f..b2239156b7de 100644
@@ -318,10 +318,11 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp)
 
 	might_sleep();
 	for_each_possible_cpu(cpu) {
-		struct cgroup *pos = cgroup_rstat_updated_list(cgrp, cpu);
+		struct cgroup *pos;
 
 		/* Reacquire for each CPU to avoid disabling IRQs too long */
 		__cgroup_rstat_lock(cgrp, cpu);
+		pos = cgroup_rstat_updated_list(cgrp, cpu);
 		for (; pos; pos = pos->rstat_flush_next) {
 			struct cgroup_subsys_state *css;
 
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 11 lines · Shakeel Butt

The commit 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking") during cleanup accidentally changed the code to call cgroup_rstat_updated_list() without cgroup_rstat_lock which is required. Fix it.

Fixes 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking")

Applied to cgroup/for-6.15-fixes.

Thanks.

Signature · 1 line
tejun
Reviewed-by on v1 1/1
#2 lore raw
In reply to Shakeel Butt
Quoted 6 lines · Shakeel Butt

The commit 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking") during cleanup accidentally changed the code to call cgroup_rstat_updated_list() without cgroup_rstat_lock which is required. Fix it.

Quoted 6 lines
Fixes 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking")

Thanks for fixing this.

Tested-by on v1 1/1
#3 lore raw
In reply to Shakeel Butt
Quoted 11 lines · Shakeel Butt

The commit 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking") during cleanup accidentally changed the code to call cgroup_rstat_updated_list() without cgroup_rstat_lock which is required. Fix it.

Fixes 093c8812de2d ("cgroup: rstat: Cleanup flushing functions and locking")