Re: [PATCH] Tight check of pfn_valid on sparsemem - v4

From: Minchan Kim
Date: Tue Jul 27 2010 - 18:33:15 EST


On Tue, Jul 27, 2010 at 11:34 PM, Christoph Lameter
<cl@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, 27 Jul 2010, Minchan Kim wrote:
>
>> But in fact I have a concern to use PG_reserved since it can be used
>> afterward pfn_valid normally to check hole in non-hole system. So I
>> think it's redundant.

Ignore me. I got confused.

>
> PG_reserved is already used to mark pages not handled by the page
> allocator (see mmap_init_zone).


I will resend below approach.

static inline int memmap_valid(unsigned long pfn)
{
struct page *page = pfn_to_page(pfn);
struct page *__pg = virt_to_page(page);
return page_private(__pg) == MAGIC_MEMMAP && PageReserved(__pg);
}

Thanks, all.


--
Kind regards,
Minchan Kim
--
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/