Thread (19 messages) 19 messages, 6 authors, 2021-03-24

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

From: Jacob Pan <hidden>
Date: 2021-03-24 16:15:40
Also in: kvm, linux-doc, lkml

Hi Vipin,

On Mon, 22 Mar 2021 11:54:39 -0700, Vipin Sharma [off-list ref] wrote:
On Fri, Mar 19, 2021 at 02:28:01PM -0700, Jacob Pan wrote:
quoted
On Thu,  4 Mar 2021 15:19:45 -0800, Vipin Sharma [off-list ref]
wrote:  
quoted
+#ifndef _MISC_CGROUP_H_
+#define _MISC_CGROUP_H_
+  
nit: should you do #include <linux/cgroup.h>?
Otherwise, css may be undefined.  
User of this controller will use get_curernt_misc_cg() API which returns
a pointer. Ideally the user should use this pointer and they shouldn't
have any need to access "css" in their code. They also don't need to
create a object of 'struct misc_cg{}', because that won't be correct misc
cgroup object. They should just declare a pointer like we are doing here
in 'struct kvm_sev_info {}'.

If they do need to use "css" then they can include cgroup header in their
code.
I didn't mean the users of misc_cgroup will use css directly. I meant if I
want to use misc cgruop in ioasid.c, I have to do the following to avoid
undefined css:
#include <linux/cgroup.h>
#include <linux/misc_cgroup.h>

So it might be simpler if you do #include <linux/cgroup.h> inside
misc_cgroup.h. Then in ioasid.c, I only need to do
#include <linux/misc_cgroup.h>.
Let me know if I am overlooking something here.

Thanks
Vipin Sharma

Thanks,

Jacob
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help