Re: [patch 2/2] m68k: Discontinuous memory support

Andrew Morton
2007-05-30T00:44:53Z

On Mon, 28 May 2007 21:16:32 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> + for_each_online_pgdat(pgdat) {
> + for (i = 0; i < pgdat->node_spanned_pages; i++) {
> + struct page *page = pgdat->node_mem_map + i;
> + total++;
> + if (PageReserved(page))
> + reserved++;
> + else if (PageSwapCache(page))
> + cached++;
> + else if (!page_count(page))
> + free++;

This isn't really true. Callers of the page allocator don't _have_ to use
page_count(): they can internally perform their own refcounting. One such
caller is slab, so this "free" count can end up being grossly wrong.

> + else
> + shared += page_count(page) - 1;
> + }