Re: [RFC 1/2] cgroup: sev: Add misc cgroup controller
From: Michal Koutný
Date: Thu Feb 25 2021 - 04:54:53 EST
On Wed, Feb 24, 2021 at 08:57:36PM -0800, Vipin Sharma <vipinsh@xxxxxxxxxx> wrote:
> This function is meant for hot unplug functionality too.
Then I'm wondering if the current form is sufficient, i.e. the generic
controller can hardly implement preemption but possibly it should
prevent any additional charges of the resource. (Or this can be
implemented the other subsystem and explained in the
misc_cg_set_capacity() docs.)
> Just to be on the same page are you talking about adding an events file
> like in pids?
Actually, I meant just the kernel log message. As it's the simpler part
and even pid events have some inconsistencies wrt hierarchical
reporting.
> However, if I take reference at the first charge and remove reference at
> last uncharge then I can keep the ref count in correct sync.
I see now how it works. I still find it a bit complex. What about making
misc_cg an input parameter and making it the callers responsibility to
keep a reference? (Perhaps with helpers for the most common case.)
Thanks,
Michal
Attachment:
signature.asc
Description: Digital signature