Thread (16 messages) 16 messages, 4 authors, 2021-09-02

Re: [PATCH v3 2/2] x86/sgx: Add SGX_MemTotal to /proc/meminfo

flat view

From: Jarkko Sakkinen <jarkko@kernel.org>
Date: 2021-09-01 01:51:39
Also in: lkml

On Thu, 2021-08-26 at 15:27 -0700, Randy Dunlap wrote:
On 8/26/21 1:27 PM, Dave Hansen wrote:
quoted
On 8/26/21 9:17 AM, Jarkko Sakkinen wrote:
quoted
quoted
I would prefer to see this listed in Documentation/filesystems/proc.rst
as an optional field, depending on CONFIG_X86_SGX.
Or at least put a reference in proc.rst to this doc file and its
supplemental fields.

thanks.
I *can* put it there but I did have reason not to, i.e. these attributes
are neither there:

DirectMap4k:     3930904 kB
DirectMap2M:    29440000 kB
DirectMap1G:     1048576 kB

And they are implemented in arch specific code.

Actually they are undocumented, e.g.

$ git grep DirectMap4k
arch/powerpc/mm/book3s64/pgtable.c:     seq_printf(m, "DirectMap4k:    %8lu kB\n",
arch/s390/mm/pageattr.c:        seq_printf(m, "DirectMap4k:    %8lu kB\n",
arch/x86/mm/pat/set_memory.c:   seq_printf(m, "DirectMap4k:    %8lu kB\n",
Yeah, we need to add some arch-specific sections to the documentation.
That *could* just be a reference over to a new file:

	Documentation/x86/meminfo.rst

along with whatever other arches provide their own fields too.
Yes, either way works. Thanks.
I'm wondering why /sys/devices/system/node/nodeX/meminfo is not
documented?  At least I could not find its documentation anywhere.

It would actually make more sense not to add anything at all
/proc/meminfo but rather add SGX_MemTotal to
/sys/devices/system/node/nodeX/meminfo because it is easy enough for
user space to calculate the final value. It's just a sum of constants
(no races).

Given the per-node granularity, maybe the arch-specific documentation
should be in Documentation/x86/node-meminfo.rst?

So I'm thinking to drop /proc/meminfo change and report SGX stats only
per-node.

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