The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will 
appear at [email protected]:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.18.vz10
------>
commit 1bd1f6e5b824c9da86872e25ffdc83fc05cd5f3b
Author: Chen Ridong <[email protected]>
Date:   Wed Nov 19 11:36:40 2025 +0800

    ms/cgroup,freezer: fix incomplete freezing when attaching tasks
    
    An issue was found:
    
            # cd /sys/fs/cgroup/freezer/
            # mkdir test
            # echo FROZEN > test/freezer.state
            # cat test/freezer.state
            FROZEN
            # sleep 1000 &
            [1] 863
            # echo 863 > test/cgroup.procs
            # cat test/freezer.state
            FREEZING
    
    When tasks are migrated to a frozen cgroup, the freezer fails to
    immediately freeze the tasks, causing the cgroup to remain in the
    "FREEZING".
    
    The freeze_task() function is called before clearing the CGROUP_FROZEN
    flag. This causes the freezing() check to incorrectly return false,
    preventing __freeze_task() from being invoked for the migrated task.
    
    To fix this issue, clear the CGROUP_FROZEN state before calling
    freeze_task().
    
    mFixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic")
    Cc: [email protected] # v6.1+
    Reported-by: Zhong Jiawei <[email protected]>
    Signed-off-by: Chen Ridong <[email protected]>
    Acked-by: Michal Koutný <[email protected]>
    Signed-off-by: Tejun Heo <[email protected]>
    
    https://virtuozzo.atlassian.net/browse/VSTOR-118578
    (cherry picked from commit 37fb58a7273726e59f9429c89ade5116083a213d)
    Signed-off-by: Pavel Tikhomirov <[email protected]>
    
    Feature: fix ms/freeze
---
 kernel/cgroup/legacy_freezer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/cgroup/legacy_freezer.c b/kernel/cgroup/legacy_freezer.c
index 23035df43a0e0..10b643dd570db 100644
--- a/kernel/cgroup/legacy_freezer.c
+++ b/kernel/cgroup/legacy_freezer.c
@@ -193,13 +193,12 @@ static void freezer_attach(struct cgroup_taskset *tset)
                if (!(freezer->state & CGROUP_FREEZING)) {
                        __thaw_task(task);
                } else {
-                       freeze_task(task);
-
                        /* clear FROZEN and propagate upwards */
                        while (freezer && (freezer->state & CGROUP_FROZEN)) {
                                freezer->state &= ~CGROUP_FROZEN;
                                freezer = parent_freezer(freezer);
                        }
+                       freeze_task(task);
                }
        }
 
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to