public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	the arch/x86 maintainers <x86@kernel.org>,
	Yinghai Lu <yinghai@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] x86: add brk allocator for very early allocations
Date: Wed, 11 Mar 2009 16:53:25 -0700	[thread overview]
Message-ID: <49B84EF5.3090705@goop.org> (raw)
In-Reply-To: <m1mybrzx1x.fsf@fess.ebiederm.org>

Eric W. Biederman wrote:
> extend_brk is the wrong way to go.  We already have a better mechanism.
> find_e820_early paired with reserve_early.
>   

No doubt that's a better option when available.  But I want to allocate 
earlier than that.

> Allocating the early page tables are a very special case.   There is
> a case for cleaning up that mechanism and making more comprehensible.
> We should not be generalizing it, and making the kernel more fragile.
>   

More fragile?  I don't see that extend_brk() is a particularly fragile 
mechanism.  I guess a user could start over-using it and running out of 
the initial space.  That would fail in a fairly unambiguous way (there's 
a BUG_ON checking for an attempt to extend beyond __brk_limit), and 
would definitely be an abuse of the call.

My motivation for this patch is to dynamically allocate things very 
early, before the e820 map is available.  Specifically, I want to 
dynamically allocate various Xen datastructures which would otherwise 
statically waste space in the bss (in the case where you're running a 
Xen-enabled kernel on a non-Xen system).  It also allows me to scale 
them according to the memory size, etc.  I need to do this before e820 
is available; indeed, I need to do it to synthesize an appropriate e820 
map for the kernel to consume.

It is also nice that it generalizes head_32.S's pagetable construction, 
and mops up the bespoke DMI allocator.  There may well be some other 
potential users.  I think any static data in bss is fair game, 
particularly if it is only used conditionally.

    J

      reply	other threads:[~2009-03-11 23:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 16:59 [GIT PULL] x86: add brk allocator for very early allocations Jeremy Fitzhardinge
2009-03-11 18:19 ` Yinghai Lu
2009-03-12 23:59   ` Jeremy Fitzhardinge
2009-03-13  0:44     ` Yinghai Lu
2009-03-13 20:27       ` Jeremy Fitzhardinge
2009-03-13 21:03         ` Yinghai Lu
2009-03-13 22:45         ` H. Peter Anvin
2009-03-13 22:59           ` Jeremy Fitzhardinge
2009-03-13 23:20             ` Yinghai Lu
2009-03-14  0:23               ` Jeremy Fitzhardinge
2009-03-11 19:20 ` Eric W. Biederman
2009-03-11 23:53   ` Jeremy Fitzhardinge [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=49B84EF5.3090705@goop.org \
    --to=jeremy@goop.org \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=x86@kernel.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