Re: Tools better than vmstat [was: 2.4.9-ac16 good perfomer?]

Russell King (rmk@arm.linux.org.uk)
Sat, 29 Sep 2001 00:00:00 +0100


On Fri, Sep 28, 2001 at 03:33:01PM -0700, Mike Fedyk wrote:
> Is sysrq easier to code for, or initiate-on-proc-read?

It's more to do with the framework that the debug code uses - you
effectively provide it with a function to do whatever analysis you
want on the pages, and it calls it for each and every page in each
zone. After each zone, it calls it with NULL to allow you to
display any statistics you've gathered for the zone.

It repeats this across all nodes and all zones, so you get the full
picture.

There are currently two functions implemented - dump the raw data
for every single page in an easy to read format (but it is very
verbose, and takes a long time to dump out on large machines).
The second gives a summary of reserved, slab, ramdisk, free and
anonymous pages found in the zone.

I guess you'd need to do something like:

static unsigned int zone_age[MAX_AGE - MIN_AGE];

static void page_ages(struct page *page)
{
int i;
if (page) {
zone_age[page->age - MIN_AGE]++;
return;
}

for (i = MIN_AGE; i < MAX_AGE; i++) {
printk(" Age %d: %u pages\n", i, zone_age[i]);
zone_age[i] = 0;
}
}

I'll dig out the patch tomorrow.

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- 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/