[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f755161-ec7e-4785-b0ca-ea68c01785a2@huaweicloud.com>
Date: Fri, 15 Nov 2024 09:14:32 +0800
From: Chen Ridong <chenridong@...weicloud.com>
To: Tejun Heo <tj@...nel.org>
Cc: Valentin Schneider <vschneid@...hat.com>, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, mkoutny@...e.com >> Michal Koutný
<mkoutny@...e.com>, linux-kernel@...r.kernel.org, wangweiyang2@...wei.com,
cgroups@...r.kernel.org
Subject: Re: [PATCH] freezer, sched: report the frozen task stat as 'D'
On 2024/11/15 0:44, Tejun Heo wrote:
> Hello,
>
> On Thu, Nov 14, 2024 at 03:47:58PM +0800, Chen Ridong wrote:
>> On 2024/11/13 22:34, Valentin Schneider wrote:
>>> On 11/11/24 13:54, Chen Ridong wrote:
>>>> From: Chen Ridong <chenridong@...wei.com>
>>>>
>>>> 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.
>
> The whole point of the freezer rewrite was preventing userspace from causing
> arbitrary and indefinite D states which leads to all sorts of problems. The
> tasks in cgroup2 freezer are *not* in uninterruptible sleeps. They are in
> task stop loops and thus can be killed, ptraced and so on. It *should*
> report S.
>
> Thanks.
>
Hi, Tj, There is no ambiguity what cgroup v2 shows. However, in cgroup
v1, the frozen tasks are reported as 'R'. Do you think this is reseanable?
Thanks,
Ridong
Powered by blists - more mailing lists