Re: [PATCH v16 05/16] x86/sgx: Implement basic EPC misc cgroup functionality

From
Huang, Kai <hidden>
Date
2024-08-27 10:21:13
Also in
lkml
Reply to
Haitao Huang, 2024-08-21
On Tue, 2024-08-20 at 18:53 -0700, Haitao Huang wrote:
quoted hunk ↗ jump to hunk
+/**
+ * Register capacity and ops for SGX cgroup.
+ * Only called at the end of sgx_init() when SGX is ready to handle the ops
+ * callbacks.
+ */
Got this warning when building with W=1:

arch/x86/kernel/cpu/sgx/epc_cgroup.c:420: warning: This comment starts with
'/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-
doc.rst
 * Register capacity and ops for SGX cgroup.

It should be fixed.
quoted hunk ↗ jump to hunk
+void __init sgx_cgroup_register(void)
+{
+	unsigned int nid = first_node(sgx_numa_mask);
+	unsigned int first = nid;
+	u64 capacity = 0;
+
+	misc_cg_set_ops(MISC_CG_RES_SGX_EPC, &sgx_cgroup_ops);
+
+	/* sgx_numa_mask is not empty when this is called */
+	do {
+		capacity += sgx_numa_nodes[nid].size;
+		nid = next_node_in(nid, sgx_numa_mask);
+	} while (nid != first);
+	misc_cg_set_capacity(MISC_CG_RES_SGX_EPC, capacity);
+}
Nit (leave to you):

Is sgx_cgroup_enable() better?
Thread (42 messages) 42 messages, 4 authors, last reply 2024-08-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help