Patch "sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE" has been added to the 6.1-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

    sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE

to the 6.1-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:
     sched-core-report-correct-state-for-task_idle-task_f.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 003832ae24ccdf4177589ca0fa81ce94dee14aa9
Author: NeilBrown <neilb@xxxxxxx>
Date:   Wed Aug 30 09:04:19 2023 +1000

    sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE
    
    [ Upstream commit 0d6b35283bcf1a379cf20066544af8e6a6b16b46 ]
    
    task_state_index() ignores uninteresting state flags (such as
    TASK_FREEZABLE) for most states, but for TASK_IDLE and TASK_RTLOCK_WAIT
    it does not.
    
    So if a task is waiting TASK_IDLE|TASK_FREEZABLE it gets incorrectly
    reported as TASK_UNINTERRUPTIBLE or "D".  (it is planned for nfsd to
    change to use this state).
    
    Fix this by only testing the interesting bits and not the irrelevant
    bits in __task_state_index()
    
    Signed-off-by: NeilBrown <neilb@xxxxxxx>
    Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/169335025927.5133.4781141800413736103@xxxxxxxxxxxxxxxxxxxxx
    Stable-dep-of: f718faf3940e ("freezer, sched: Report frozen tasks as 'D' instead of 'R'")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0cac69902ec5..205a00806835 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1663,7 +1663,7 @@ static inline unsigned int __task_state_index(unsigned int tsk_state,
 
 	BUILD_BUG_ON_NOT_POWER_OF_2(TASK_REPORT_MAX);
 
-	if (tsk_state == TASK_IDLE)
+	if ((tsk_state & TASK_IDLE) == TASK_IDLE)
 		state = TASK_REPORT_IDLE;
 
 	/*
@@ -1671,7 +1671,7 @@ static inline unsigned int __task_state_index(unsigned int tsk_state,
 	 * to userspace, we can make this appear as if the task has gone through
 	 * a regular rt_mutex_lock() call.
 	 */
-	if (tsk_state == TASK_RTLOCK_WAIT)
+	if (tsk_state & TASK_RTLOCK_WAIT)
 		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