Breakdown of noncache kernel's dynamic memory

592 Views Asked by At

I found this answer about the noncache memory for kernel: https://unix.stackexchange.com/questions/62066/what-is-kernel-dynamic-memory-as-reported-by-smem

I have similar question, problem, but I don't have zram as mentioned in the question above.

My question is, how can I break down the 'noncache' memory reported by the smem utility? I know hugetables are one part of it, but what else? I couldn't find after some longer search how to do that, and I guess I would have to deep dive in kernel code to get some sense of it, if I even could.

Below you can find reports from smem, free and /proc/meminfo. Noncache for kernel dynamic memory in smem output is calculated as memtotal - userspace - free - cache and - hugetabes in my version. My questions is, what fields should I sum up from /proc/meminfo to get the Noncache figure of 704576? Or same question posted differently, when you breakdown noncache kernel memory, what fields from /proc/meminfo contribute to it?

smem (https://www.selenic.com/smem/):

] smem -wt
Area                           Used      Cache   Noncache  Hugepages
firmware/hardware                 0          0          0          0
kernel image                      0          0          0          0
kernel dynamic memory       2117736     706600     704576     706560
userspace memory             783384     156516     626868          0
free memory                10665504   10665504          0          0
---------------------------------------------------------------------
                           13566624   11528620    1331444     706560

Free:

free -h
              total        used        free      shared  buff/cache   available
Mem:            12G        1.9G         10G         63M        842M         10G
Swap:            9G        513M        9.5G

And /proc/meminfo:

MemTotal:       13566624 kB
MemFree:        10668220 kB
MemAvailable:   11048420 kB
Buffers:          158544 kB
Cached:           649660 kB
SwapCached:       229900 kB
Active:           545392 kB
Inactive:        1059268 kB
Active(anon):      74132 kB
Inactive(anon):   787872 kB
Active(file):     471260 kB
Inactive(file):   271396 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      10485756 kB
SwapFree:        9960188 kB
Dirty:              2176 kB
Writeback:             0 kB
AnonPages:        621768 kB
Mapped:           154476 kB
Shmem:             65520 kB
KReclaimable:      54912 kB
Slab:             123356 kB
SReclaimable:      54912 kB
SUnreclaim:        68444 kB
KernelStack:       11280 kB
PageTables:         8456 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    16915788 kB
Committed_AS:    2715192 kB
VmallocTotal:   135290159040 kB
VmallocUsed:       29464 kB
VmallocChunk:          0 kB
Percpu:            16512 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:          65536 kB
CmaFree:           63760 kB
HugePages_Total:     345
HugePages_Free:        1
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:          706560 kB
0

There are 0 best solutions below