mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Early memory patch, revised
Date: 25 Feb 2004 23:16:00 -0700	[thread overview]
Message-ID: <m11xoifjrz.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <403ADCDD.8080206@zytor.com>

"H. Peter Anvin" <hpa@zytor.com> writes:
> Hi all,

While looking and understanding what this code does I have found
a real bug.

> +/* 
> + * This is how much memory *in addition to the memory covered up to
> + * and including _end* we need mapped initially.  We need one bit for
> + * each possible page, which currently means 2^36/4096/8 = 2 MB
> + * (64-bit-capable chips can do more, but if you have more than 64 GB
> + * of memory you *really* should be running a 64-bit kernel.  However,
> + * if this really bothers someone we could query this dynamically.)
> + *
> + * The other thing we may want to do dynamically in the future is to
> + * detect PSE and skip generating the PTEs.
> + *
> + * Modulo rounding, each megabyte assigned here requires a kilobyte of
> + * memory, which is currently unreclaimed.
> + *
> + * This should be a multiple of a page.
>   */

The comment about the bootmem is wrong and misleading.  The bootmem
bitmap only included low memory.  So in the worst case with a 4G/4G split
it can be 2^32/4096/8 = 128KiB.  Normally the worst case is only 32KiB with
a 3G/1G split.

> +#define INIT_MAP_BEYOND_END	(2*1024*1024)

#define INIT_MAP_BEYOND_END (128*1024)
is the correct value here.

Eric

      parent reply	other threads:[~2004-02-26  6:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-24  5:10 H. Peter Anvin
2004-02-25 18:26 ` Eric W. Biederman
2004-02-25 18:38   ` H. Peter Anvin
2004-02-25 18:49   ` H. Peter Anvin
2004-02-26 14:56     ` [PATCH] Early memory patch, +accounting Eric W. Biederman
2004-02-26 18:02       ` H. Peter Anvin
2004-03-01  7:06         ` Eric W. Biederman
2004-02-26  6:16 ` Eric W. Biederman [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=m11xoifjrz.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®