Patch "freezer, sched: Report frozen tasks as 'D' instead of 'R'" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    freezer, sched: Report frozen tasks as 'D' instead of 'R'

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     freezer-sched-report-frozen-tasks-as-d-instead-of-r.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1a960f9fb097035967f72477f7d8e00966a68856
Author: Chen Ridong <chenridong@xxxxxxxxxx>
Date:   Tue Dec 17 00:48:18 2024 +0000

    freezer, sched: Report frozen tasks as 'D' instead of 'R'
    
    [ Upstream commit f718faf3940e95d5d34af9041f279f598396ab7d ]
    
    Before commit:
    
      f5d39b020809 ("freezer,sched: Rewrite core freezer logic")
    
    the frozen task stat was reported as 'D' in cgroup v1.
    
    However, after rewriting the core freezer logic, the frozen task stat is
    reported as 'R'. This is confusing, especially when a task with stat of
    'S' is frozen.
    
    This bug can be reproduced with these steps:
    
            $ cd /sys/fs/cgroup/freezer/
            $ mkdir test
            $ sleep 1000 &
            [1] 739         // task whose stat is 'S'
            $ echo 739 > test/cgroup.procs
            $ echo FROZEN > test/freezer.state
            $ ps -aux | grep 739
            root     739  0.1  0.0   8376  1812 pts/0    R    10:56   0:00 sleep 1000
    
    As shown above, a task whose stat is 'S' was changed to 'R' when it was
    frozen.
    
    To solve this regression, simply maintain the same reported state as
    before the rewrite.
    
    [ mingo: Enhanced the changelog and comments ]
    
    Fixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic")
    Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
    Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
    Acked-by: Tejun Heo <tj@xxxxxxxxxx>
    Acked-by: Michal Koutný <mkoutny@xxxxxxxx>
    Link: https://lore.kernel.org/r/20241217004818.3200515-1-chenridong@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4809f27b5201..d4f9d82c69e0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1683,8 +1683,9 @@ static inline unsigned int __task_state_index(unsigned int tsk_state,
 	 * We're lying here, but rather than expose a completely new task state
 	 * to userspace, we can make this appear as if the task has gone through
 	 * a regular rt_mutex_lock() call.
+	 * Report frozen tasks as uninterruptible.
 	 */
-	if (tsk_state & TASK_RTLOCK_WAIT)
+	if ((tsk_state & TASK_RTLOCK_WAIT) || (tsk_state & TASK_FROZEN))
 		state = TASK_UNINTERRUPTIBLE;
 
 	return fls(state);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux