linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russ Anderson <rja@sgi.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Yinghai Lu <yinghai@kernel.org>,
	David Miller <davem@davemloft.net>
Cc: Russ Anderson <rja@sgi.com>
Subject: [patch] mm: nobootmem: fix sign extend problem in __free_pages_memory()
Date: Mon, 7 May 2012 14:32:03 -0500	[thread overview]
Message-ID: <20120507193202.GA11518@sgi.com> (raw)

Systems with 8 TBytes of memory or greater can hit a problem 
where only the the first 8 TB of memory shows up.  This is
due to "int i" being smaller than "unsigned long start_aligned",
causing the high bits to be dropped.

The fix is to change i to unsigned long to match start_aligned
and end_aligned.

Thanks to Jack Steiner (steiner@sgi.com) for assistance tracking
this down.

Signed-off-by: Russ Anderson <rja@sgi.com>

---
 mm/nobootmem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux/mm/nobootmem.c
===================================================================
--- linux.orig/mm/nobootmem.c	2012-05-05 08:39:39.470845187 -0500
+++ linux/mm/nobootmem.c	2012-05-05 08:39:42.714784530 -0500
@@ -82,8 +82,7 @@ void __init free_bootmem_late(unsigned l
 
 static void __init __free_pages_memory(unsigned long start, unsigned long end)
 {
-	int i;
-	unsigned long start_aligned, end_aligned;
+	unsigned long i, start_aligned, end_aligned;
 	int order = ilog2(BITS_PER_LONG);
 
 	start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);
-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com

             reply	other threads:[~2012-05-07 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07 19:32 Russ Anderson [this message]
2012-05-07 21:32 ` [patch] mm: nobootmem: fix sign extend problem in __free_pages_memory() Andrew Morton
2012-05-08 20:16 ` Yinghai Lu

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=20120507193202.GA11518@sgi.com \
    --to=rja@sgi.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).