From: Dan Malek <dan@embeddededge.com>
To: Pantelis Antoniou <panto@intracom.gr>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: kmalloc and startup process
Date: Tue, 17 Dec 2002 11:44:22 -0500 [thread overview]
Message-ID: <3DFF5466.3050606@embeddededge.com> (raw)
In-Reply-To: 3DFF1DF4.8010005@intracom.gr
Pantelis Antoniou wrote:
> At what point in the startup process is it OK to call
> kmalloc?
Before you start hacking up things that are "broken", you
should probably take a moment to understand why they are
currently implemented the way they are.
The CPM support functions are called _very_ early in the
kernel to support such features as KGDB on the serial ports.
Currently, the host memory allocator uses bootmem pages
because they are only option for allocating memory that early.
There are three host memory allocators that are used to
support CPM functions. One is the 'cpm_hostalloc()' space,
which is available early and used for small objects like
uart fifos. Second is the consistent DMA functions which
are used in the places like the Ethernet driver. Third is
the kernel kmalloc() function which must be futher managed
with the cache coherency functions. They all have advantages
and features that meet various driver requirements. You may
need to use several layers of initialization to make this
happen, just like any other Linux driver. Some must be
done at kernel initialization, others can be postponed until
later. When you think driver support functions are "broken"
you may want to stop and consider that maybe your driver
writing techniques are broken and investigate how these
functions are working successfully for others.
I would strongly suggest that the only thing to "fix" is to
add a trivial space manager to some statically configurable
number of bootmem pages. The old UNIX resouce map allocator
would be a perfect algorithm to manage this space.
Thanks.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2002-12-17 16:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-17 12:52 kmalloc and startup process Pantelis Antoniou
2002-12-17 13:19 ` Joakim Tjernlund
2002-12-17 13:40 ` Pantelis Antoniou
2002-12-17 15:06 ` Pantelis Antoniou
2002-12-17 16:44 ` Dan Malek [this message]
2002-12-18 12:34 ` Pantelis Antoniou
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=3DFF5466.3050606@embeddededge.com \
--to=dan@embeddededge.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=panto@intracom.gr \
/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).