Re: [RFC][PATCH] counting bounce pages.

From: Andrew Morton
Date: Mon Apr 25 2005 - 05:57:07 EST


KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
>
> This is a patch for counting bounce pages.
> With this, pages for bounce buffer is coutned and shown in /proc/meminfo.

As it's purely a debug thing, perhaps /proc/vmstat would be a better place
for displaying this info.

> Because pages for bounce buffer are not counted in anywhere,
> sometimes it seems that there are many leaked pages.
> ex)
> I found 1.7GB of bounce buffer pages in a crash dump of ia64 kernel,
> which was passed me to check memory usage. :(

whoops.

> BTW, I'm not sure whether # of bounce buffer should be includeded in Buffers:
> of /proc/meminfo.

No, "Buffers:" is "the number of bytes allocated to blockdevice pagecache".
Usually this is filesystem metadata.

> --- linux-2.6.12-rc2-mm3/fs/proc/proc_misc.c~count_bounce 2005-04-25 12:08:28.000000000 +0900
> +++ linux-2.6.12-rc2-mm3-kamezawa/fs/proc/proc_misc.c 2005-04-25 16:06:39.000000000 +0900
> @@ -114,7 +114,7 @@ static int uptime_read_proc(char *page,
>
> return proc_calc_metrics(page, start, off, count, eof, len);
> }
> -
> +extern atomic_t nr_bounce_pages;

Please always put extern declarations into .h files, with the declaration
visible to the definition and to all users.

> + "Bounce : %8lu kB\n"

There's an unneeded space in there.

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