linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH -v1] MIPS: fix pfn_valid() for FLATMEM
Date: Thu, 8 Oct 2009 22:21:12 +0200	[thread overview]
Message-ID: <200910082221.12649.rjw@sisk.pl> (raw)
In-Reply-To: <1255001548-30567-1-git-send-email-wuzhangjin@gmail.com>

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 <pavel@ucw.cz>
>  and Sergei Shtylyov <sshtylyov@ru.mvista.com>)

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

Thanks,
Rafael

  reply	other threads:[~2009-10-08 20:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08 11:32 [PATCH -v1] MIPS: fix pfn_valid() for FLATMEM Wu Zhangjin
2009-10-08 20:21 ` Rafael J. Wysocki [this message]
2009-10-08 20:44   ` Ralf Baechle
2009-10-09  2:08     ` Wu Zhangjin
2009-10-09 16:02       ` Wu Zhangjin
2009-10-13 22:04         ` Ralf Baechle
2009-10-14  1:06           ` Wu Zhangjin
  -- strict thread matches above, loose matches on Subject: below --
2009-10-09 16:15 Wu Zhangjin
2009-10-09 16:20 ` Wu Zhangjin
2009-10-10 14:38 ` Wu Zhangjin
2009-10-10 19:19   ` Wu Zhangjin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200910082221.12649.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-mips@linux-mips.org \
    --cc=pavel@ucw.cz \
    --cc=ralf@linux-mips.org \
    --cc=sshtylyov@ru.mvista.com \
    --cc=wuzhangjin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).