Re: [RFC PATCH v2 bpf-next 0/3] bpf: cgroup: support writing and freezing cgroups from BPF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 25, 2025 at 11:48 AM Tejun Heo <tj@xxxxxxxxxx> 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.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux