mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* shmem info issue
@ 2013-07-12 11:38 naveen yadav
  2013-07-12 22:58 ` Hugh Dickins
  0 siblings, 1 reply; 2+ messages in thread
From: naveen yadav @ 2013-07-12 11:38 UTC (permalink / raw)
  To: kernelnewbies, linux-kernel

 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@localhost linux-3.8.2]# cat /proc/meminfo | grep -r Shmem
Shmem:               704 kB
[root@localhost 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 )
2-> as per the developer comments NR_SHMEM included tmpfs and GEM
pages whct is Gem pages
3-> is my above code analysis is correct?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: shmem info issue
  2013-07-12 11:38 shmem info issue naveen yadav
@ 2013-07-12 22:58 ` Hugh Dickins
  0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2013-07-12 22:58 UTC (permalink / raw)
  To: naveen yadav; +Cc: kernelnewbies, linux-kernel

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@localhost linux-3.8.2]# cat /proc/meminfo | grep -r Shmem
> Shmem:               704 kB
> [root@localhost 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-12 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12 11:38 shmem info issue naveen yadav
2013-07-12 22:58 ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®