From: David Gibson <david@gibson.dropbear.id.au>
To: Dan Malek <dan@embeddededge.com>
Cc: Paul Mackerras <paulus@samba.org>,
Tom Rini <trini@kernel.crashing.org>,
linuxppc-embedded@lists.linuxppc.org
Subject: Re: consistent_free()
Date: Sat, 15 Jun 2002 16:57:52 +1000 [thread overview]
Message-ID: <20020615065752.GH1124@zax> (raw)
In-Reply-To: <3D0ADE69.6040905@embeddededge.com>
On Sat, Jun 15, 2002 at 02:27:53AM -0400, Dan Malek wrote:
>
> Paul Mackerras wrote:
>
> >"Consistent" means "the cpu and the device see the same stuff in
> >memory". On a cache-coherent system that is true of all normal
> >memory. Surely that is obvious?
>
> Not really. You have seen enough messages about people wanting to
> get "uncached" memory, even though this isn't necessary.
>
> We also don't want to be remapping 'consistent' space on those
> processors that don't require it, one of the primary functions
> of consistent_alloc() so it works properly on noncoherent processors.
We don't.
> Basically, David Gibson moved an 'ifdef' from one place to another,
> and then had to write a consistent_alloc function for processors that
> didn't need it before, placing more code in an include file no less.
> How does that add value to the kernel? It just complicated the
> maintenance of a function that is similar across multiple architectures.
Oh fer cryin' out loud. Before any non-PCI driver that wanted DMA
consistent memory and wanted to work on both cache-coherent and
non-cache coherent would have to have an ifdef on
CONFIG_NOT_COHERENT_CACHE. If it was on, it would have to use
consistent_alloc(), other wise it could just allocate the memory
normally (with kmalloc() or get_free_pages()) since consistency comes
for free on cache coherent processors.
I just made consistent_alloc() do for cache coherent processors
exactly what the driver would have to do anyway if
CONFIG_NOT_COHERENT_CACHE were not set. The cache coherent
implementation of consistent_alloc() is utterly trivial, and does not
remapping. If we really don't want to be calling consistent_alloc()
on cache coherent processors it should BUG() or cause a link error,
rather than just failing.
Admittedly pci_alloc_consistent() was (so far) the only place this
happened, because every other user of consistent_alloc() was basically
in a driver which would only ever be used on non cache coherent
processors.
--
David Gibson | For every complex problem there is a
david@gibson.dropbear.id.au | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
prev parent reply other threads:[~2002-06-15 6:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-14 4:29 consistent_free() David Gibson
2002-06-14 5:57 ` consistent_free() David Gibson
2002-06-24 2:15 ` consistent_free() David Gibson
2002-06-25 14:39 ` consistent_free() Tom Rini
2002-06-26 5:17 ` consistent_free() David Gibson
2002-06-26 5:33 ` consistent_free() Dan Malek
2002-06-26 5:59 ` consistent_free() David Gibson
2002-06-26 14:32 ` consistent_free() Paul Mackerras
2002-06-27 2:42 ` consistent_free() David Gibson
2002-06-14 15:39 ` consistent_free() Tom Rini
2002-06-14 16:44 ` consistent_free() Dan Malek
2002-06-14 17:10 ` consistent_free() Tom Rini
2002-06-14 21:34 ` consistent_free() Dan Malek
2002-06-15 6:11 ` consistent_free() Paul Mackerras
2002-06-15 6:42 ` consistent_free() Dan Malek
2002-06-15 10:02 ` consistent_free() Paul Mackerras
2002-06-15 13:51 ` consistent_free() Dan Malek
2002-06-15 6:02 ` consistent_free() Paul Mackerras
2002-06-15 6:27 ` consistent_free() Dan Malek
2002-06-15 6:57 ` David Gibson [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=20020615065752.GH1124@zax \
--to=david@gibson.dropbear.id.au \
--cc=dan@embeddededge.com \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=paulus@samba.org \
--cc=trini@kernel.crashing.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;
as well as URLs for NNTP newsgroup(s).