From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: move memory layout sanity checking before meminfo initialization
Date: Fri, 15 Jul 2011 09:09:51 +0100 [thread overview]
Message-ID: <20110715080950.GL23270@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAMbhsRSgUcFPpdTFvEDTFfo_Wk0k7BQzwk6cRtXC6K7mpQ+YDg@mail.gmail.com>
On Thu, Jul 14, 2011 at 03:10:51PM -0700, Colin Cross wrote:
> With CONFIG_CMDLINE_EXTEND, accidentally using two mem= options is
> going to become more common (that's how I did it). Would you accept a
> patch for 3.1/3.2 that would make incorrect mem= handling more robust?
The issue here is that mem= parameters are not supposed to overlap.
While there can be multiple mem= parameters, there is no sure way to
tell when one should override previous parameters.
> Investigating a little more, the problem happens in free_unused_memmap
> when two banks ordered by bank_start have reverse order bank_end.
> prev_bank_end gets set too low, and the area between bank_end of the
> previous two banks gets freed when a third bank is processed.
>
> I can either drop extra mem= options if they overlap with a previous
> one, try to copy the memblock data back into meminit after memblock
> has handled the overlapping case, or fix up free_unused_memblock to
> only increase prev_bank_end.
You can't do that. We keep the original meminfo data because memblock
coalesces the information and that breaks the sparse bank stuff (we need
to know where the boundaries are even when banks are fully populated.)
I think probably the best solution is to get rid of CMDLINE_EXTEND to
stop people walking blindly into this trap.
next prev parent reply other threads:[~2011-07-15 8:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 18:57 [PATCH] ARM: move memory layout sanity checking before meminfo initialization Russell King - ARM Linux
2011-07-05 19:20 ` Nicolas Pitre
2011-07-14 6:52 ` Colin Cross
2011-07-14 7:34 ` Russell King - ARM Linux
2011-07-14 7:58 ` Colin Cross
2011-07-14 22:10 ` Colin Cross
2011-07-15 8:09 ` Russell King - ARM Linux [this message]
2011-07-15 16:06 ` Colin Cross
2011-07-15 16:16 ` Russell King - ARM Linux
2011-07-15 17:35 ` Colin Cross
2011-07-15 18:13 ` Russell King - ARM Linux
2011-07-15 20:58 ` Colin Cross
2011-07-15 21:07 ` Russell King - ARM Linux
2011-07-15 21:18 ` Colin Cross
2011-07-15 21:58 ` Russell King - ARM Linux
2011-07-15 22:13 ` Colin Cross
2011-07-16 22:41 ` Nicolas Pitre
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=20110715080950.GL23270@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).