Re: [PATCH 3/3] statm: shared = rss - anon_rss

From: William Lee Irwin III
Date: Mon Oct 25 2004 - 14:39:17 EST


On Sun, Oct 24, 2004 at 04:49:48PM +0100, Hugh Dickins wrote:
> The third "shared" field of /proc/$pid/statm in 2.4 was a count of pages
> in the mm whose page_count is more than 1 (oddly, including pages shared
> just with swapcache). That's too costly to calculate each time, so 2.6
> changed it to the total file-backed extent. But Andrea knows apps and
> users surprised when (rss - shared) goes negative: we need to provide
> an rss-like statistic, close to the 2.4 interpretation.
> Something that's quick and easy to maintain accurately is mm->anon_rss,
> the count of anonymous pages in the mm. Then shared = rss - anon_rss
> gives a pretty good and meaningful approximation to 2.4's intention:
> wli confirms that this will be useful to Oracle too.
> Where to show it? I think it's best to treat this as a bugfix and show
> it in the third field of /proc/$pid/statm, after resident, as before -
> there's no evidence that the total file-backed extent was found useful.
> Albert would like other fields to revert to page counts, but that's a
> lot harder: if mprotect can change the category of a page, then it can't
> be accounted as simply as this. Only go that route if real need shown.

The group maintaining the tools relying upon the properties of the
shared field of statm at Oracle has gone beyond code inspection of the
patches, and as of today has carried out runtime testing of your
patches and verified that it resolves the issue to their full
satisfaction during runtime operation of the tools.

-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/