From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753310AbcDVOJ5 (ORCPT ); Fri, 22 Apr 2016 10:09:57 -0400 Received: from forward16m.cmail.yandex.net ([5.255.216.147]:50059 "EHLO forward16m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbcDVOJz (ORCPT ); Fri, 22 Apr 2016 10:09:55 -0400 X-Greylist: delayed 599 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 Apr 2016 10:09:55 EDT Authentication-Results: smtp4m.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0 Date: Fri, 22 Apr 2016 17:03:46 +0300 From: Oleg To: linux-kernel@vger.kernel.org Subject: /proc/meminfo: relations of values Message-ID: <20160422140346.GA8825@localhost> Reply-To: Oleg MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)