linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: mm: Don't free prohibited memmap entries
Date: Mon, 12 Apr 2010 22:11:15 +0100	[thread overview]
Message-ID: <20100412211115.GX3048@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4BBBD2CD.2010205@codeaurora.org>

On Tue, Apr 06, 2010 at 05:33:17PM -0700, Michael Bohan wrote:
> On 4/6/2010 3:08 PM, Russell King - ARM Linux wrote:
>> 1. are you enabling ARCH_HAS_HOLES_MEMORYMODEL ?
>>    
>
> Yes, although this does not impact the problem I'm dealing with.  That  
> option is only used for /proc/pagetypeinfo currently.  It would be good  
> if we could consolidate ARCH_HAS_HOLES_MEMORYMODEL and HOLES_IN_ZONE,  
> but that may be out of scope for this change.
>
>> 2. where does it try to access these page structs without trying
>>     pfn_valid() to check whether a page struct exists first?
>>    
>
> The specific piece of code that is causing crashes in my scenario is in  
> vm/page_alloc.c:move_freepages(), called from move_freepages_block().   
> The code in move_freepages_block aligns the end_pfn to the closest page  
> block, which may take us to invalid memmap entries.
>
> The macro that conditionally saves us in this case is the  
> pfn_valid_within(), called from move_freepages().  If HOLES_IN_ZONE is  
> configured, this option calls down to pfn_valid() to make sure the page  
> has a valid memmap entry.  There are likely other cases where this is an  
> issue as well that I haven't run into.

Well, there's two ways to look at this - either you should ensure
that memory is available up to MAX_ORDER_NR_PAGES, possibly reducing
this number of that's necessary to achive this.

Or, we need to have ARCH_HAS_HOLES_MEMORYMODEL needs to select
HOLES_IN_ZONE so we get proper checking of PFNs - maybe conditional on
MSM.  I think most users of ARCH_HAS_HOLES_MEMORYMODEL align memory to
a power-of-two amount of memory, and so MAX_ORDER_NR_PAGES doesn't
cause them a problem.

  reply	other threads:[~2010-04-12 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 22:34 [PATCH] arm: mm: Don't free prohibited memmap entries Michael Bohan
2010-04-06 22:08 ` Russell King - ARM Linux
2010-04-07  0:33   ` Michael Bohan
2010-04-12 21:11     ` Russell King - ARM Linux [this message]
2010-04-12 22:31       ` Michael Bohan

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=20100412211115.GX3048@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).