public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: John Marvin <jsm@udlkern.fc.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] Revised fix for show_mem panic
Date: Mon, 15 Mar 2004 12:33:07 +0000	[thread overview]
Message-ID: <200403151233.i2FCX7519363@udlkern.fc.hp.com> (raw)

--- a/arch/ia64/mm/contig.c	Fri Mar 12 07:17:21 2004
+++ b/arch/ia64/mm/contig.c	Fri Mar 12 05:59:24 2004
@@ -46,6 +46,8 @@
 	printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
+		if (!pfn_valid(i))
+			continue;
 		total++;
 		if (PageReserved(mem_map+i))
 			reserved++;
--- a/arch/ia64/mm/discontig.c	Fri Mar 12 07:17:21 2004
+++ b/arch/ia64/mm/discontig.c	Fri Mar 12 06:15:26 2004
@@ -377,6 +377,8 @@
 	for_each_pgdat(pgdat) {
 		printk("Node ID: %d\n", pgdat->node_id);
 		for(i = 0; i < pgdat->node_spanned_pages; i++) {
+			if (!ia64_pfn_valid(pgdat->node_start_pfn+i))
+				continue;
 			if (PageReserved(pgdat->node_mem_map+i))
 				reserved++;
 			else if (PageSwapCache(pgdat->node_mem_map+i))
--- a/arch/ia64/mm/init.c	Fri Mar 12 07:17:21 2004
+++ b/arch/ia64/mm/init.c	Mon Mar 15 04:55:08 2004
@@ -455,8 +455,11 @@
 ia64_pfn_valid (unsigned long pfn)
 {
 	char byte;
+	struct page *pg = pfn_to_page(pfn);
 
-	return __get_user(byte, (char *) pfn_to_page(pfn)) = 0;
+	return     (__get_user(byte, (char *) pg) = 0)
+		&& ((((u64)pg & PAGE_MASK) = (((u64)(pg + 1) - 1) & PAGE_MASK))
+			|| (__get_user(byte, (char *) (pg + 1) - 1) = 0));
 }
 EXPORT_SYMBOL(ia64_pfn_valid);
 

             reply	other threads:[~2004-03-15 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 12:33 John Marvin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-15 12:40 [PATCH] Revised fix for show_mem panic John Marvin

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=200403151233.i2FCX7519363@udlkern.fc.hp.com \
    --to=jsm@udlkern.fc.hp.com \
    --cc=linux-ia64@vger.kernel.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