Re: [RFC v2 6/6] android: binder: Add a buffer flag to relinquish ownership of fds

From: John Stultz
Date: Mon Feb 14 2022 - 15:49:03 EST


On Mon, Feb 14, 2022 at 12:19 PM Todd Kjos <tkjos@xxxxxxxxxx> wrote:
> On Mon, Feb 14, 2022 at 11:29 AM Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote:
> > On Mon, Feb 14, 2022 at 10:33 AM Todd Kjos <tkjos@xxxxxxxxxx> wrote:
> > >
> > > Since we are creating a new gpu cgroup abstraction, couldn't this
> > > "transfer" be done in userspace by the target instead of in the kernel
> > > driver? Then this patch would reduce to just a flag on the buffer
> > > object.
> >
> > Are you suggesting to have a userspace accessible cgroup interface for
> > transferring buffer charges and the target process to use that
> > interface for requesting the buffer to be charged to its cgroup?
>
> Well, I'm asking why we need to do these cgroup-ish actions in the
> kernel when it seems more natural to do it in userspace.
>

In case its useful, some additional context from some of the Linux
Plumber's discussions last fall:

Daniel Stone outlines some concerns with the cgroup userland handling
for accounting:
https://youtu.be/3OqllZONTiQ?t=3430

And the binder ownership transfer bit was suggested here by Daniel Vetter:
https://youtu.be/3OqllZONTiQ?t=3730

thanks
-john