On Mon, Aug 25, 2025 at 11:48 AM Tejun Heo tj@kernel.org wrote:
Hello,
On Fri, Aug 22, 2025 at 07:16:15PM +0100, Djalal Harouni wrote: ...
I do realize taking the same usual path with write is the obvious thing, but we don't have the corresponding open context, and faking it seems more trouble than calling directly cgroup backends...
Allow me please to do it again directly on cgroup_base_file[] assuming it was Alexei suggestion and see how it looks.
It's been 1.5 year since v1. It's safe to assume that all opinions have changed, including mine.
I'm probably missing something but what prevents you from getting a dentry from kernfs_node and then calling vfs_open() on it and then do vfs_write() on the returned file?
Generic vfs ops from kfunc feels like a can of worms. It will require a lot more thinking and coordination with vfs folks. I'd rather keep things simple especially, since this thread might continue in 2026.
If there are some fundamental reasons that we can't do something like that, let's go back to the simple approach where we just have bpf helpers for freezing and unfreezing cgroups outside of fs interface.
I'd just do whatever version of cgroup_lock*() is necessary from kfunc followed by cgroup_freeze(), and limit kfunc to sleepable progs, of course.