linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: fix pfn_valid() for FLAGMEM

To: Wu Zhangjin <wuzhangjin@gmail.com>
Subject: Re: [PATCH] MIPS: fix pfn_valid() for FLAGMEM
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 8 Oct 2009 16:42:30 +0200
Cc: linux-mips@linux-mips.org, "Rafael J. Wysocki" <rjw@sisk.pl>, Pavel Machek <pavel@ucw.cz>
In-reply-to: <1254992252-15923-1-git-send-email-wuzhangjin@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1254992252-15923-1-git-send-email-wuzhangjin@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.19 (2009-01-05)
On Thu, Oct 08, 2009 at 04:57:32PM +0800, Wu Zhangjin wrote:

> When CONFIG_FLAGMEM enabled, STD/Hiberation will fail on YeeLoong
> laptop, This patch fix it:
> 
> if pfn is between min_low_pfn and max_mapnr, the old pfn_valid() will
> return TRUE, but in reality, if the memory is not continuous, it should
> be false. for example:

Hm...  All that pfn_valid() indicates is that a page frame number is valid
to index a pfn.  That is that a pfn is valid to index the mem_map array.

> $ cat /proc/iomem | grep "System RAM"
> 00000000-0fffffff : System RAM
> 90000000-bfffffff : System RAM
> 
> as we can see, it is not continuous, so, some of the memory is not valid
> but regarded as valid by pfn_valid(), and at last make STD/Hibernate
> fail when shrinking a too large number of invalid memory.
> 
> Here, we fix it via checking pfn is in the "System RAM" or not, if yes,
> return TRUE.

Are the non-memory parts marked as reserved?

  Ralf

<Prev in Thread] Current Thread [Next in Thread>