<div dir="ltr"><div>
<div class="gmail-post-text">
<p>As I read from <a href="http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=HEAD#l451" rel="nofollow noreferrer">http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=HEAD#l451</a> (line 906)</p>
<blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><i>the Shmem field in /proc/meminfo: Total memory used by shared memory
(shmem) and tmpfs</i></p></blockquote>
</blockquote>
<p>tmpfs size: </p>
<pre><code>/proc # df -Thk |grep -E "tmpfs|Used"
Filesystem Type 1K-blocks Used Available Use% Mounted on
devtmpfs devtmpfs 1963344 8 1963336 1% /dev
tmpfs tmpfs 2027904 728 2027176 1% /dev/shm
tmpfs tmpfs 2027904 9936 2017968 1% /run
tmpfs tmpfs 2027904 0 2027904 0% /sys/fs/cgroup
</code></pre>
<p><i>total (tmpfs) size: 8+ 728 + 9936 = 10672 kB</i></p>
<p>shared mem by ipc<br></p>
<pre><code>/proc # ipcs -mu
------ Shared Memory Status --------
segments allocated 23
pages allocated 1855
pages resident 1855
pages swapped 0
Swap performance: 0 attempts 0 successes
/proc # getconf PAGESIZE
4096
</code></pre>
<p>-->ipcs shared mem = 1855 * 4096/1024 = 7420kB</p>
<p><span style="background-color:rgb(255,0,0)"><strong>> 7420kB (ipcs mem) + 10672 (tmpfs) = 18092 Kb</strong></span></p>
<p>** </p>
<pre><code>/proc # cat /proc/meminfo |grep Shmem
<span style="background-color:rgb(255,0,0)">Shmem: 18096 kB </span>
</code></pre>
<p>which is different from Shmem in meminfo 4Kb
could you help me about "where is 4Kb located?"</p><p>Thank you so much<br></p></div></div></div>