From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Fix virtual kernel memory printing for sparsemem
Date: Thu, 25 Mar 2010 14:53:24 +0000 [thread overview]
Message-ID: <20100325145324.12837.85927.stgit@e102109-lin.cambridge.arm.com> (raw)
Commit db9ef1a introduced information printing for the virtual kernel
memory map but page/end calculation using the pfn goes wrong and
page_count() generates a data abort or alignment fault (possibly because
it gets to an uninitialised page structure that looks like a compound
page).
This patch adds page/end calculation using pfn_to_page().
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <Will.Deacon@arm.com>
Cc: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
---
arch/arm/mm/init.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index b69ac3a..8a48634 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -600,9 +600,6 @@ void __init mem_init(void)
reserved_pages = free_pages = 0;
for_each_online_node(node) {
- pg_data_t *n = NODE_DATA(node);
- struct page *map = pgdat_page_nr(n, 0) - n->node_start_pfn;
-
for_each_nodebank(i, &meminfo, node) {
struct membank *bank = &meminfo.bank[i];
unsigned int pfn1, pfn2;
@@ -611,8 +608,8 @@ void __init mem_init(void)
pfn1 = bank_pfn_start(bank);
pfn2 = bank_pfn_end(bank);
- page = map + pfn1;
- end = map + pfn2;
+ page = pfn_to_page(pfn1);
+ end = pfn_to_page(pfn2 - 1) + 1;
do {
if (PageReserved(page))
next reply other threads:[~2010-03-25 14:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 14:53 Catalin Marinas [this message]
2010-03-25 15:10 ` [PATCH] ARM: Fix virtual kernel memory printing for sparsemem Russell King - ARM Linux
2010-03-25 15:24 ` Catalin Marinas
2010-03-25 15:30 ` Russell King - ARM Linux
2010-03-25 15:37 ` Will Deacon
2010-03-25 16:01 ` Catalin Marinas
2010-03-25 17:46 ` Will Deacon
2010-05-04 16:13 ` Marek Vasut
2010-05-04 16:18 ` Russell King - ARM Linux
2010-05-04 16:28 ` Catalin Marinas
2010-05-04 17:00 ` Marek Vasut
2010-05-04 16:02 ` Marek Vasut
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=20100325145324.12837.85927.stgit@e102109-lin.cambridge.arm.com \
--to=catalin.marinas@arm.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).