linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dima@android.com (Dima Zavin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: mm: enforce pageblock alignment when freeing memmap entries at init
Date: Thu, 20 Jan 2011 15:47:11 -0800	[thread overview]
Message-ID: <1295567231-2384-1-git-send-email-dima@android.com> (raw)

On some machines, the nodes do not always start on pageblock
boundaries. In these cases it is possible for free_unused_memmap
to free mappings for pages inside a pageblock with otherwise
valid pages. This presents problems for page migration since it
operates on whole pageblocks at a time.

Round down bank_start to pageblock boundary so that whole
pageblocks always have valid mappings.

Signed-off-by: Dima Zavin <dima@android.com>
---
 arch/arm/mm/init.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 5164069..98de5d8 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -418,7 +418,11 @@ static void __init free_unused_memmap(struct meminfo *mi)
 	for_each_bank(i, mi) {
 		struct membank *bank = &mi->bank[i];
 
-		bank_start = bank_pfn_start(bank);
+		/* Round bank_start down to the start of a pageblock so that
+		 * all pages in a pageblock always have a mapping.
+		 */
+		bank_start = round_down(bank_pfn_start(bank),
+					MAX_ORDER_NR_PAGES);
 
 		/*
 		 * If we had a previous bank, and there is a space
-- 
1.7.3.1

             reply	other threads:[~2011-01-20 23:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 23:47 Dima Zavin [this message]
2011-01-21 23:02 ` [PATCH] ARM: mm: enforce pageblock alignment when freeing memmap entries at init Larry Bassel
2011-01-26  8:29 ` Mel Gorman
2011-01-26 21:57   ` Dima Zavin
2011-01-29 18:35     ` Dima Zavin
2011-02-03 13:30     ` Mel Gorman
2011-02-09 21:39       ` Dima Zavin

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=1295567231-2384-1-git-send-email-dima@android.com \
    --to=dima@android.com \
    --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).