linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux.com>
To: Chris Friesen <cfriesen@nortel.com>
Cc: linux-kernel@vger.kernel.org, linux-mm <linux-mm@kvack.org>
Subject: Re: how to tell if arbitrary kernel memory address is backed by physical memory?
Date: Fri, 17 Apr 2009 12:27:43 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.1.10.0904171224530.7261@qirst.com> (raw)
In-Reply-To: <49E8AB11.4000708@nortel.com>


On Fri, 17 Apr 2009, Chris Friesen wrote:

> We have a mips board that appears to have holes in the lowmem mappings such
> that blindly walking all of it causes problems.  I assume the allocator knows
> about these holes and simply doesn't assign memory at those addresses.

Yes memory is registered in distinct ranges during boot.

> We may have found a solution though...it looks like virt_addr_valid() returns
> false for the problematic addresses.  Would it be reasonable to call this once
> for each page before trying to access it?

Sure. Note that virt_addr_valid only ensures that there is a page
struct for that address. You may need to ensure that PageReserved(page) is
false if you want to make sure that you have actual memory there that is
valid to use.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2009-04-17 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 15:37 Chris Friesen
2009-04-16 20:58 ` Christoph Lameter
2009-04-17 16:15   ` Chris Friesen
2009-04-17 16:27     ` Christoph Lameter [this message]

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=alpine.DEB.1.10.0904171224530.7261@qirst.com \
    --to=cl@linux.com \
    --cc=cfriesen@nortel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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