Linux cgroups development
 help / color / mirror / Atom feed
* freezing() returned false when the cgroup is being frozen
@ 2025-10-18  9:02 Qu Wenruo
  2025-10-18 23:22 ` Tejun Heo
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2025-10-18  9:02 UTC (permalink / raw)
  To: cgroups

Hi,

Recently I'm fixing a bug that a long running btrfs ioctl can prevent 
suspension and cgroup freezing.

The root cause is btrfs lacks the proper checks to abort the ioctl, so 
that the process can return to user space.

The fix is not that hard, normally some freezing() checks.

But I noticed that in the ioctl context, if the pm triggered freezing, 
then freezing(current) properly returned true.

However if a cgroup freezing is triggered for the process running the 
btrfs ioctl, freezing(current) will still return false.

The pm code has dedicated booleans, thus when pm is involved it 
freezing_slow_path() just checks @pm_nosig_freezing and @pm_freezing 
flags driectly.


On the hand for cgroup freezing case, it has to go cgroup_freezing() to 
check if the cgroup is freezing.

Not familiar with cgroup, but it looks like the CGROUP_FREEZING bits are 
only set during freezer_css_online(), but not sure if for the long 
running ioctl case it's properly triggered.


Anyway the freezing() checks can be worked around by checking pending 
signals inside btrfs, as cgroup freezing will send a wakeup signal to 
the process.

Just curious if the freezing(current) is supposed to return false for 
the cgroup freezing case.

Thanks,
Qu

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-19  5:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18  9:02 freezing() returned false when the cgroup is being frozen Qu Wenruo
2025-10-18 23:22 ` Tejun Heo
2025-10-18 23:32   ` Qu Wenruo
2025-10-19  5:26     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox