Re: [RFC][patch 0/2] mm: remove PageReserved

Nick Piggin
2005-08-09T09:29:30Z

Russell King wrote:
> On Tue, Aug 09, 2005 at 02:59:53PM +1000, Nick Piggin wrote:
>
>>That would work for swsusp, but there are other users that want to
>>know if a struct page is valid ram (eg. ioremap), so in that case
>>swsusp would not be able to mess with the flag.
>
>
> The usage of "valid ram" here is confusing - that's not what PageReserved
> is all about. It's about valid RAM which is managed by method other
> than the usual page counting. Non-reserved RAM is also valid RAM, but
> is managed by the kernel in the usual way.
>

Well that is one usage of the PageReserved flag. That one tends
to be easily covered by VM_RESERVED (ie. it is no longer used that
way after the patches).

The remaining problem is, in fact, these "other" uses of PageReserved.
One usage definitely appears to be "is this page valid RAM?".

> The former is available for remap_pfn_range and ioremap, the latter is
> not.
>

I thought ioremap was attempting to avoid remapping physical
RAM with that check. All drivers I have looked at which allocate
physical memory then SetPageReserved the pages use remap_pfn_range
but I admit that's not a huge number (that I have looked at).

> On the other hand, the validity of an apparant RAM address can only be
> tested using its pfn with pfn_valid().
>

I'm fairly sure that's not the case on i386 at least. I think
pfn_valid will be true if the pfn points to a struct page.
See arch/i386/mm/init.c:one_highpage_init()

> Can we straighten out the terminology so it's less confusing please?
>

That's what I'm aiming for. I admit it is confusing and I haven't
looked at all drivers or architectures, so if I'm missing a vital
clue then I wouldn't be too surprised ;)

Nick

--
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com