From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 3 Jul 2008 23:28:21 +0100 (BST) From: Hugh Dickins Subject: Re: [RFC][-mm] [3/7] add shmem page to active list. In-Reply-To: <20080703164320.1087f758.kamezawa.hiroyu@jp.fujitsu.com> Message-ID: References: <20080702210322.518f6c43.kamezawa.hiroyu@jp.fujitsu.com> <20080702211057.7a7cf3dc.kamezawa.hiroyu@jp.fujitsu.com> <20080703091144.93465ba5.kamezawa.hiroyu@jp.fujitsu.com> <20080703132730.b64dcd19.kamezawa.hiroyu@jp.fujitsu.com> <20080703164320.1087f758.kamezawa.hiroyu@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: KAMEZAWA Hiroyuki Cc: "linux-mm@kvack.org" , "balbir@linux.vnet.ibm.com" , "xemul@openvz.org" , "nishimura@mxp.nes.nec.co.jp" , "yamamoto@valinux.co.jp" , "kosaki.motohiro@jp.fujitsu.com" List-ID: On Thu, 3 Jul 2008, KAMEZAWA Hiroyuki wrote: > On Thu, 3 Jul 2008 08:03:17 +0100 (BST) > Hugh Dickins 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: email@kvack.org