mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Ridong <chenridong@huaweicloud.com>
To: Tejun Heo <tj@kernel.org>
Cc: "Valentin Schneider" <vschneid@redhat.com>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	"mkoutny@suse.com >> Michal Koutný" <mkoutny@suse.com>,
	linux-kernel@vger.kernel.org, wangweiyang2@huawei.com,
	cgroups@vger.kernel.org
Subject: Re: [PATCH] freezer, sched: report the frozen task stat as 'D'
Date: Fri, 15 Nov 2024 09:14:32 +0800	[thread overview]
Message-ID: <2f755161-ec7e-4785-b0ca-ea68c01785a2@huaweicloud.com> (raw)
In-Reply-To: <ZzYo19k9ZvkC7V-1@slm.duckdns.org>



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@huawei.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


  reply	other threads:[~2024-11-15  1:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 13:54 Chen Ridong
2024-11-13 14:34 ` Valentin Schneider
2024-11-14  7:47   ` Chen Ridong
2024-11-14 16:44     ` Tejun Heo
2024-11-15  1:14       ` Chen Ridong [this message]
2024-11-15  1:28         ` Tejun Heo
2024-11-25  2:14           ` Chen Ridong
2024-12-04  1:52             ` Chen Ridong
2024-12-11 16:02               ` Michal Koutný
2024-12-13  1:18                 ` Chen Ridong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f755161-ec7e-4785-b0ca-ea68c01785a2@huaweicloud.com \
    --to=chenridong@huaweicloud.com \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=wangweiyang2@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®