linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Russ Anderson <rja@sgi.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	David Miller <davem@davemloft.net>
Subject: Re: [patch] mm: nobootmem: fix sign extend problem in __free_pages_memory()
Date: Tue, 8 May 2012 13:16:08 -0700	[thread overview]
Message-ID: <CAE9FiQXuaJqq9HH-_mOqJHM4Veyz-Yw85we7=26b=dkfgW73dQ@mail.gmail.com> (raw)
In-Reply-To: <20120507193202.GA11518@sgi.com>

On Mon, May 7, 2012 at 12:32 PM, Russ Anderson <rja@sgi.com> wrote:
> 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.

when you have 8T installed, you should get [0,2g), [4g, 8T+2g)

if you have more than that. [2g, 4g) could be added as ram together
with MMIO....

>
> 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);

Acked-by: Yinghai Lu <yinghai@kernel.org>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2012-05-08 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07 19:32 Russ Anderson
2012-05-07 21:32 ` Andrew Morton
2012-05-08 20:16 ` Yinghai Lu [this message]

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='CAE9FiQXuaJqq9HH-_mOqJHM4Veyz-Yw85we7=26b=dkfgW73dQ@mail.gmail.com' \
    --to=yinghai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rja@sgi.com \
    /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