[Top] [All Lists]

Re: [PATCH -v1] MIPS: fix pfn_valid() for FLATMEM

To: Wu Zhangjin <>
Subject: Re: [PATCH -v1] MIPS: fix pfn_valid() for FLATMEM
From: "Rafael J. Wysocki" <>
Date: Thu, 8 Oct 2009 22:21:12 +0200
Cc:, Ralf Baechle <>, Sergei Shtylyov <>, Pavel Machek <>
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: KMail/1.12.1 (Linux/2.6.32-rc3-rjw; KDE/4.3.1; x86_64; ; )
On Thursday 08 October 2009, Wu Zhangjin wrote:
> When CONFIG_FLATMEM enabled, STD/Hiberation will fail on YeeLoong
> laptop, This patch fixes 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:
> $ 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. and
> Seems pfn_valid() is not called in assembly code, we move it to
> "!__ASSEMBLY__" to ensure we can simply declare it via "extern int
> pfn_valid(unsigned long)" without Compiling Error.
> (This -v1 version incorporates feedback from Pavel Machek <>
>  and Sergei Shtylyov <>)

Hmm.  What exactly would be wrong with using register_nosave_region() or
register_nosave_region_late() like x86 does?


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