From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: sparclinux@vger.kernel.org
Subject: Re: memblock versus bootmem (relevant for sparc32?)
Date: Sat, 23 Apr 2011 23:20:46 +0000 [thread overview]
Message-ID: <1303600846.2513.130.camel@pasglop> (raw)
In-Reply-To: <20110423174200.GA25324@merkur.ravnborg.org>
On Sat, 2011-04-23 at 19:42 +0200, Sam Ravnborg wrote:
> Hi Ben, Yinghai, Ingo.
>
> While doing some sparc related tasks I noticed that sparc64
> uses memblock - whereas sparc32 does not.
>
> I am aware that memblock was called lmb in the older days and
> that sparc64 had lmb support which was converted to memblock support.
>
> But so far I have failed to find any information on what the benefit
> of memblock is and how it compared to for example bootmem.
> I can see that x86 no longer uses bootmem - as the only arch.
Mostly memblock works earlier and handles both the actual physical
memory layout and allocation within that memory. Archs like powerpc
still use memblock, then bootmem, then page alloc.
x86 eventually removed the bootmem step in the middle, which is a good
thing, unfortunately...
> But I also noticed that mm/nobootmem.c contains several functions
> named bla_x86_bla(). So I continued to be a bit confused.
... as you noticed, this is all quite horrible with x86 junk in generic
places etc... and so I haven't yet looked at doing that on powerpc as
well (though I'd like to at some stage).
> Do there exist any writeup of what memblock is?
Other than the code ? :-) It's a very simple region list management
which works on two lists, one represents the physical memory in the
system and the other represents reserved areas and can be used as an
allocator (or to reserve "FW" regions etc...).
It initially worked entirely on static arrays (it used to be that way so
it can be used very early during boot), but it now grew the ability to
re-allocate its own arrays so that it can be used more generically as an
allocator instead of bootmem.
It's probably slower than bootmem tho, but on the other hand it
shouldn't be on any critical path.
> Also does it make sense to consider introducing memblock for sparc32.
> And if yes - what is the benefit and what does it replace?
I will let DaveM reply here :-)
> And would it make sense to drop bootmem on sparc64?
>
> I know - lots of questions!
Cheers,
Ben.
> Sam
next prev parent reply other threads:[~2011-04-23 23:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-23 17:42 memblock versus bootmem (relevant for sparc32?) Sam Ravnborg
2011-04-23 23:20 ` Benjamin Herrenschmidt [this message]
2011-04-24 8:22 ` Sam Ravnborg
2011-04-24 21:01 ` Yinghai Lu
2011-04-24 21:14 ` Sam Ravnborg
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=1303600846.2513.130.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.