[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1007281005440.21717@router.home>
Date: Wed, 28 Jul 2010 10:14:51 -0500 (CDT)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Minchan Kim <minchan.kim@...il.com>
cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Milton Miller <miltonm@....com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Russell King <linux@....linux.org.uk>,
Mel Gorman <mel@....ul.ie>,
Johannes Weiner <hannes@...xchg.org>,
Kukjin Kim <kgene.kim@...sung.com>
Subject: Re: [PATCH] Tight check of pfn_valid on sparsemem - v4
On Wed, 28 Jul 2010, Minchan Kim wrote:
> static inline int memmap_valid(unsigned long pfn)
> {
> struct page *page = pfn_to_page(pfn);
> struct page *__pg = virt_to_page(page);
Does that work both for vmemmap and real mmapping?
> return page_private(__pg) == MAGIC_MEMMAP && PageReserved(__pg);
> }
Problem is that pages may be allocated for the mmap from a variety of
places. The pages in mmap_init_zone() and allocated during boot may have
PageReserved set whereas the page allocated via vmemmap_alloc_block() have
PageReserved cleared since they came from the page allocator.
You need to have consistent use of PageReserved in page structs for the
mmap in order to do this properly.
Simplest scheme would be to clear PageReserved() in all page struct
associated with valid pages and clear those for page structs that do not
refer to valid pages.
Then
mmap_valid = !PageReserved(xxx(pfn_to_page(pfn))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists