lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1307121529190.3315@eggly.anvils>
Date:	Fri, 12 Jul 2013 15:58:38 -0700 (PDT)
From:	Hugh Dickins <hughd@...gle.com>
To:	naveen yadav <yad.naveen@...il.com>
cc:	kernelnewbies <Kernelnewbies@...nelnewbies.org>,
	linux-kernel@...r.kernel.org
Subject: Re: shmem info issue

On Fri, 12 Jul 2013, naveen yadav wrote:
>  Hi All
> 
> I am working on tmpfs. During code analysis I found shmem driver
> register itself as tmpfs .
> 
> cat /proc/meminfo Shmem field read NR_SHMEM enum filed and shows used
> memory in tmpfs
> 
> 
> [root@...alhost linux-3.8.2]# cat /proc/meminfo | grep -r Shmem
> Shmem:               704 kB
> [root@...alhost linux-3.8.2]#
> 
> include/linux/mmzone.h
> enum zone_stat_item {
> -----cut here-------
>  NR_SHMEM,               /* shmem pages (included tmpfs/GEM pages
>  -----cut here
> }
> 
> I have the following query
> 1-> cat /proc/meminfo | grep -r Shmem show only the used tmpfs memory
> or it show used  tmpfs memory + mata data also (because I found Shmem
> is bit larger then tempfs used memory )

"Shmem" includes only data, not metadata, nor memory currently swapped
out.  But it includes tmpfs memory, SysV shared memory (from ipc/shm.c),
POSIX shared memory (under /dev/shm), and shared anonymous mappings
(from mmap of /dev/zero with MAP_SHARED: see call to shmem_zero_setup()
from drivers/char/mem.c): whatever allocates pages through mm/shmem.c.

> 2-> as per the developer comments NR_SHMEM included tmpfs and GEM
> pages whct is Gem pages

Ah yes, and the Graphics Execution Manager uses shmem for objects shared
with the GPU: see use of shmem_read_mapping_page*() in drivers/gpu/drm/.

> 3-> is my above code analysis is correct?

I think so.

Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ