Re: [Patch v3 0/2] cgroup: New misc cgroup controller

From: Vipin Sharma
Date: Mon Mar 22 2021 - 14:25:36 EST


On Mon, Mar 15, 2021 at 08:10:09PM +0100, Michal Koutný wrote:
> On Fri, Mar 12, 2021 at 09:49:26AM -0800, Vipin Sharma <vipinsh@xxxxxxxxxx> wrote:
> > I will add some more information in the cover letter of the next version.
> Thanks.
>
> > Each one coming up with their own interaction is a duplicate effort
> > when they all need similar thing.
> Could this be expressed as a new BPF hook (when allocating/freeing such
> a resource unit)?
>
> The decision could be made based on the configured limit or even some
> other predicate.
>
> (I saw this proposed already but I haven't seen some more reasoning
> whether it's worse/better. IMO, BPF hooks are "cheaper" than full-blown
> controllers, though it's still new user API.)

I am not much knowledgeable with BPF, so, I might be wrong here.

There are couple of things which might not be addressed with BPF:
1. Which controller to use in v1 case? These are not abstract resources
so in v1 where each controller have their own hierarchy it might not
be easy to identify the best controller.

2. It seems to me that we won't be able to abstract out a single BPF
program which can help with all of the resources types we are
planning to use, again, because it is not an abstract type like
network packets, and there will be different places in the source
code to use these resources.

To me a cgroup tends to give much easier and well integrated solution when it
comes to scheduling and limiting a resource with existing tools in a
cloud infrastructure.

>
>
> > As per my understanding this is the only for way for loadable modules
> > (kvm-amd in this case) to access Kernel APIs. Let me know if there is a
> > better way to do it.
> I understood the symbols are exported for such modularized builds.
> However, making them non-GPL exposes them to any out-of-tree modules,
> although, the resource types are supposed to stay hardcoded in the misc
> controller. So my point was to make them EXPORT_SYMBOL_GPL to mark
> they're just a means of implementing the modularized builds and not an
> API. (But they'd remain API for out-of-tree GPL modules anyway, so take
> this reasoning of mine with a grain of salt.)
>
I see, I will change it to GPL.

Thanks
Vipin