From: Chen Ridong <chenridong@huaweicloud.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: tj@kernel.org, hannes@cmpxchg.org, rafael.j.wysocki@intel.com,
mingo@kernel.org, peterz@infradead.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, lujialin4@huawei.com,
chenridong@huawei.com
Subject: Re: [next] cgroup,freezer: fix incomplete freezing when attaching tasks
Date: Wed, 18 Jun 2025 17:03:47 +0800 [thread overview]
Message-ID: <906caca3-8564-4443-a1bd-3c18449b0d64@huaweicloud.com> (raw)
In-Reply-To: <sfmtpva4z4jxrlmmeyigz4n7wozfveii3cuaks3s4dgf6noyfg@gutbimmbjfbb>
On 2025/6/18 16:42, Michal Koutný wrote:
> On Wed, Jun 18, 2025 at 07:32:17AM +0000, Chen Ridong <chenridong@huaweicloud.com> wrote:
>> From: Chen Ridong <chenridong@huawei.com>
>>
>> An issue was found:
>
> An obligatory reminder to move to freezer in the unifier hierarchy if
> possible. Thanks for the fix though.
>
Thanks, we are trying to switch to cgroup v2. However some products are
still using cgroup v1.
Thank you for your review.
BR,
Ridong
>>
>> # cd /sys/fs/cgroup/freezer/
>> # mkdir test
>> # echo FROZEN > test/freezer.state
>> # cat test/freezer.state
>> FROZEN
>> # sleep 1000 &
>> [1] 863
>> # echo 863 > test/cgroup.procs
>> # cat test/freezer.state
>> FREEZING
>>
>> When tasks are migrated to a frozen cgroup, the freezer fails to
>> immediately freeze the tasks, causing the cgroup to remain in the
>> "FREEZING".
>>
>> The freeze_task() function is called before clearing the CGROUP_FROZEN
>> flag. This causes the freezing() check to incorrectly return false,
>> preventing __freeze_task() from being invoked for the migrated task.
>>
>> To fix this issue, clear the CGROUP_FROZEN state before calling
>> freeze_task().
>>
>> Fixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic")
>> Reported-by: Zhong Jiawei <zhongjiawei1@huawei.com>
>> Signed-off-by: Chen Ridong <chenridong@huawei.com>
>> ---
>> kernel/cgroup/legacy_freezer.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> Acked-by: Michal Koutný <mkoutny@suse.com>
next prev parent reply other threads:[~2025-06-18 9:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 7:32 Chen Ridong
2025-06-18 8:42 ` Michal Koutný
2025-06-18 9:03 ` Chen Ridong [this message]
2025-06-18 19:45 ` Tejun Heo
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=906caca3-8564-4443-a1bd-3c18449b0d64@huaweicloud.com \
--to=chenridong@huaweicloud.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huawei.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lujialin4@huawei.com \
--cc=mingo@kernel.org \
--cc=mkoutny@suse.com \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tj@kernel.org \
/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®