All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: naveen yadav <yad.naveen@gmail.com>
Cc: kernelnewbies <Kernelnewbies@kernelnewbies.org>,
	linux-kernel@vger.kernel.org
Subject: Re: shmem info issue
Date: Fri, 12 Jul 2013 15:58:38 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1307121529190.3315@eggly.anvils> (raw)
In-Reply-To: <CAJ8eaTw9o+ZBAzR+1qe-5XEpfZzv-6DJ_EHK_BF_32-va-KL+g@mail.gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: hughd@google.com (Hugh Dickins)
To: kernelnewbies@lists.kernelnewbies.org
Subject: shmem info issue
Date: Fri, 12 Jul 2013 15:58:38 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1307121529190.3315@eggly.anvils> (raw)
In-Reply-To: <CAJ8eaTw9o+ZBAzR+1qe-5XEpfZzv-6DJ_EHK_BF_32-va-KL+g@mail.gmail.com>

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

  reply	other threads:[~2013-07-12 22:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 11:38 shmem info issue naveen yadav
2013-07-12 11:38 ` naveen yadav
2013-07-12 22:58 ` Hugh Dickins [this message]
2013-07-12 22:58   ` Hugh Dickins

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=alpine.LNX.2.00.1307121529190.3315@eggly.anvils \
    --to=hughd@google.com \
    --cc=Kernelnewbies@kernelnewbies.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yad.naveen@gmail.com \
    /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.