lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <173503363300.399.9097986381691581562.tip-bot2@tip-bot2>
Date: Tue, 24 Dec 2024 09:47:13 -0000
From: "tip-bot2 for Chen Ridong" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Chen Ridong <chenridong@...wei.com>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>, Tejun Heo <tj@...nel.org>,
 mkoutny@...e.com, x86@...nel.org, linux-kernel@...r.kernel.org
Subject:
 [tip: sched/urgent] freezer, sched: report the frozen task stat as 'D'

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     2357a7f934ae01985b0b8b70c3ca59ea38b9ed5b
Gitweb:        https://git.kernel.org/tip/2357a7f934ae01985b0b8b70c3ca59ea38b9ed5b
Author:        Chen Ridong <chenridong@...wei.com>
AuthorDate:    Tue, 17 Dec 2024 00:48:18 
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 17 Dec 2024 17:47:20 +01:00

freezer, sched: report the frozen task stat as 'D'

Before the commit f5d39b020809 ("freezer,sched: Rewrite core freezer
logic"), the frozen task stat was reported as 'D' in cgroup v1.
However, after rewriting 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 can be reproduced as bellow step:
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 issue, simply maintain the same reported state as
before the rewrite.

Fixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic")
Signed-off-by: Chen Ridong <chenridong@...wei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Tejun Heo <tj@...nel.org>
Acked-by: Michal Koutný <mkoutny@...e.com>
Link: https://lore.kernel.org/r/20241217004818.3200515-1-chenridong@huaweicloud.com
---
 include/linux/sched.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 66b311f..6c98649 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1637,8 +1637,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 the frozen task uninterruptible.
 	 */
-	if (tsk_state & TASK_RTLOCK_WAIT)
+	if ((tsk_state & TASK_RTLOCK_WAIT) || (tsk_state & TASK_FROZEN))
 		state = TASK_UNINTERRUPTIBLE;
 
 	return fls(state);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ