All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg <lego12239@yandex.ru>
To: linux-kernel@vger.kernel.org
Subject: /proc/meminfo: relations of values
Date: Fri, 22 Apr 2016 17:03:46 +0300	[thread overview]
Message-ID: <20160422140346.GA8825@localhost> (raw)

  Hi, all!

Google has many explanations of what each value mean, but nothing about
relations of values (the same for Documentation/filesystems/proc.txt).

For example, i have qemu vm with x86_64 kernel:

~# dd if=/dev/zero of=tmpdata bs=$((1024*1024)) count=10; sleep 1s; \
free; cat /proc/meminfo; grep Pss: /proc/*/smaps | awk '{s+=$2} END {print s}'
             total       used       free     shared    buffers     cached
Mem:        509728      64172     445556          0       2696      38848
-/+ buffers/cache:      22628     487100
Swap:            0          0          0
MemTotal:         509728 kB
MemFree:          445556 kB
Buffers:            2696 kB
Cached:            38848 kB
SwapCached:            0 kB
Active:            18708 kB
Inactive:          28108 kB
Active(anon):       5284 kB
Inactive(anon):       28 kB
Active(file):      13424 kB
Inactive(file):    28080 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                32 kB
Writeback:          7640 kB
AnonPages:          5292 kB
Mapped:             4232 kB
Shmem:                40 kB
Slab:               8384 kB
SReclaimable:       3232 kB
SUnreclaim:         5152 kB
KernelStack:         424 kB
PageTables:          472 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      254864 kB
Committed_AS:      56380 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        2092 kB
VmallocChunk:   34359732272 kB
DirectMap4k:       10232 kB
DirectMap2M:      514048 kB
10070

If i understand correctly, 10070K is userspace size, but i don't know how can i
get this value from /proc/meminfo - AnonPages + ? ...
A part of 10070K are code segments; are they included in Cached value?
If not, then 22628K(used) - 100070K = 12558K - is this kernel memory?
Which values are compose it(Slab + ?...)?

The only relations i know are:

Active = Active(anon) + Active(file)
Inactive = Inactive(anon) + Inactive(file)
Slab = SReclaimable + SUnreclaim

Others are unknown. For example, i don't know how to get used value - 64172;
and why AnonPages is not equal nor Active(anon) nor Active(anon) + Inactive(anon)?

If anyone have the time for an answer, I will be grateful.

Thanks.

-- 
Неманов Олег (Nemanov Oleg)

                 reply	other threads:[~2016-04-22 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160422140346.GA8825@localhost \
    --to=lego12239@yandex.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.