linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"xemul@openvz.org" <xemul@openvz.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"yamamoto@valinux.co.jp" <yamamoto@valinux.co.jp>,
	"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: [RFC][-mm] [3/7] add shmem page to active list.
Date: Thu, 3 Jul 2008 23:28:21 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0807032306350.22975@blonde.site> (raw)
In-Reply-To: <20080703164320.1087f758.kamezawa.hiroyu@jp.fujitsu.com>

On Thu, 3 Jul 2008, KAMEZAWA Hiroyuki wrote:
> On Thu, 3 Jul 2008 08:03:17 +0100 (BST)
> Hugh Dickins <hugh@veritas.com> wrote:
> 
> > On Thu, 3 Jul 2008, KAMEZAWA Hiroyuki wrote:
> > > 
> > > BTW, is there a way to see the RSS usage of shmem from /proc or somewhere ?
> > 
> > No, it's just been a (very weirdly backed!) filesystem until these
> > -mm developments.  If you add such stats (for more than temporary
> > debugging), you'll need to use per_cpu counters for it: more global
> > locking or atomic ops on those paths would be sure to upset SGI.
> 
> like zone stat ?

Like that, yes.  I had been going to suggest adding another couple
of stats to that (one for in memory, one for on swap, or heading
to or from swap); but noticed that everything there is an event,
with the comment "Counters should only be incremented", so it
would be an abuse to add shmem page counts there.

> but I think struct address_space->nr_pages is updated and
> shmem's inode has alloced/swapped paremeters.

Per inode, yes.

> 
> It seems alloced == address_space->nr_pages + info->swapped, right ?

That's right (and you'll have read the comment that they can get
out of synch because of undirtied pages getting dropped: I don't
see that as any problem to worry about in your counts).

> 
> I just wanted to ask whether they are exported or not.
> (Or can I get that information by some ioctl ?)

info->swapped is not available outside mm/shmem.c, but I suppose
mapping->nr_pages is available.  But those are not what you want,
are they?  You want totals, not counts per inode.  Totalling them
up over all the inodes in all the tmpfs'es, that could be a big
job; we don't even have a list of all the inodes at present (and
more overhead to link them into and unlink them from that list).

> 
> BTW,  current meminfo is following.
> ==
> [kamezawa@blackonyx test-2.6.26-rc5-mm3++]$ cat /proc/meminfo
> MemTotal:       49471980 kB
> MemFree:        44448528 kB
> Buffers:          472412 kB
> Cached:          3721388 kB
> SwapCached:        22616 kB
> Active:           658480 kB
> Inactive:        3609828 kB
> Active(anon):      14900 kB
> Inactive(anon):    64496 kB
> Active(file):     643580 kB
> Inactive(file):  3545332 kB
> Unevictable:        2020 kB
> Mlocked:            2020 kB
> SwapTotal:       2031608 kB
> SwapFree:        1982656 kB
> Dirty:                60 kB
> Writeback:             0 kB
> AnonPages:         62476 kB
> Mapped:            32092 kB
> Slab:             548584 kB
> SReclaimable:     490284 kB
> SUnreclaim:        58300 kB
> PageTables:        12648 kB
> NFS_Unstable:          0 kB
> Bounce:                0 kB
> WritebackTmp:          0 kB
> ==
> 
> Cached = filesystem + shmem
> Active(anon) = anon-active + shmem-active
> Inactive(anon) = anon-inactive + shmem-inactive
> Active(file) = file cache-active
> Inactive(file) = file cache-inactive.
> 
> Right ?

Yes, I believe so; with the complication that SwapCached
shares pages with Active(anon) and Inactive(anon), but
includes shmem pages not at that moment counted in Cached
or Active(anon) or Inactive(anon), and includes pages which
haven't yet been identified with really-anon or shmem.

Hugh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-07-03 22:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 12:03 [RFC][-mm] [0/7] misc memcg patch set KAMEZAWA Hiroyuki
2008-07-02 12:07 ` [RFC][-mm] [1/7] shmem swapcache fix KAMEZAWA Hiroyuki
2008-07-02 12:08 ` [RFC][-mm] [2/7] delete FLAG_CACHE KAMEZAWA Hiroyuki
2008-07-02 12:10 ` [RFC][-mm] [3/7] add shmem page to active list KAMEZAWA Hiroyuki
2008-07-03  0:11   ` KAMEZAWA Hiroyuki
2008-07-03  4:27     ` KAMEZAWA Hiroyuki
2008-07-03  7:03       ` Hugh Dickins
2008-07-03  7:43         ` KAMEZAWA Hiroyuki
2008-07-03 22:28           ` Hugh Dickins [this message]
2008-07-04  0:47             ` KAMEZAWA Hiroyuki
2008-07-02 12:12 ` [RFC][-mm] [4/7] handle limit change KAMEZAWA Hiroyuki
2008-07-02 12:13 ` [RFC][-mm] [5/7] reduce usage at " KAMEZAWA Hiroyuki
2008-07-02 12:15 ` [RFC][-mm] [6/7] res_counter distance to limit KAMEZAWA Hiroyuki
2008-07-02 19:19   ` Paul Menage
2008-07-02 23:57     ` KAMEZAWA Hiroyuki
2008-07-02 12:17 ` [RFC][-mm] [7/7] background job for memcg KAMEZAWA Hiroyuki
2008-07-02 14:23 ` [RFC][-mm] [0/7] misc memcg patch set Daisuke Nishimura
2008-07-02 16:31   ` KOSAKI Motohiro
2008-07-02 23:56   ` KAMEZAWA Hiroyuki
2008-07-03  2:38 ` KAMEZAWA Hiroyuki
2008-07-03  3:06 ` KAMEZAWA Hiroyuki
2008-07-03  9:07 ` Balbir Singh
2008-07-03  9:54   ` KAMEZAWA Hiroyuki
2008-07-11  8:38 ` KAMEZAWA Hiroyuki

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=Pine.LNX.4.64.0807032306350.22975@blonde.site \
    --to=hugh@veritas.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=xemul@openvz.org \
    --cc=yamamoto@valinux.co.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox