Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932736AbXHQChy (ORCPT ); Thu, 16 Aug 2007 22:37:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761007AbXHQChr (ORCPT ); Thu, 16 Aug 2007 22:37:47 -0400 Received: from waste.org ([66.93.16.53]:40020 "EHLO waste.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760877AbXHQChq (ORCPT ); Thu, 16 Aug 2007 22:37:46 -0400 Date: Thu, 16 Aug 2007 21:38:46 -0500 From: Matt Mackall To: Fengguang Wu Cc: Andrew Morton , Jeremy Fitzhardinge , David Rientjes , John Berthels , Nick Piggin , linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] maps: /proc//pmaps interface - memory maps in granularity of pages Message-ID: <20070817023846.GJ30556@waste.org> References: <20070816220516.782145952@mail.ustc.edu.cn> <20070816220849.472883642@mail.ustc.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070816220849.472883642@mail.ustc.edu.cn> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 50 On Fri, Aug 17, 2007 at 06:05:20AM +0800, Fengguang Wu wrote: > Show a process's page-by-page address space infomation in /proc//pmaps. > It helps to analyze applications' memory footprints in a comprehensive way. > > Pages share the same states are grouped into a page range. > For each page range, the following fields are exported: > - first page index > - number of pages in the range > - well known page/pte flags > - number of mmap users > > Only page flags not expected to disappear in the near future are exported: > > Y:young R:referenced A:active U:uptodate P:ptedirty D:dirty W:writeback ... > The concern of dataset size is taken care of by working in a sparse way: > > 1) It will only generate output for resident pages, that normally is > much smaller than the mapped size. Take my shell for example, the > (size:rss) ratio is (7:1)! > > wfg ~% cat /proc/$$/smaps |grep Size|sum > sum 50552.000 > avg 777.723 > > wfg ~% cat /proc/$$/smaps |grep Rss|sum > sum 7604.000 > avg 116.985 > > 2) The page range trick suppresses more output. > > It's interesting to see that the seq_file interface demands some > more programming efforts, and provides such flexibility as well. I'm so-so on this. On the downside: - requires lots of parsing - isn't random-access - probably significantly slower than pagemap -- Mathematics is the supreme nostalgia of our time. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/