All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: kmalloc vs pci_alloc_consistent
@ 2003-07-18 14:56 Johnson, Stephen
  2003-07-18 15:33 ` Chris Zimman
  0 siblings, 1 reply; 4+ messages in thread
From: Johnson, Stephen @ 2003-07-18 14:56 UTC (permalink / raw)
  To: linuxppc-embedded


I found a nice thread of conversation that allowed me to see some of the
history behind pci_alloc_consistent().

I read one thing noted on a man page for kmalloc that should be highlighted.
"the GFP_DMA flag may be set to indicate the memory must be suitable for
DMA. ***This can mean different things on different platforms.*** For
example, on x86, it means that the memory must come from the first 16MB."

For ppc arch, how about
#define kmalloc  pci_alloc_unconsistent  /* just joking */




-----Original Message-----
From: Johnson, Stephen
Sent: Friday, July 18, 2003 8:34 AM
To: linuxppc-embedded@lists.linuxppc.org
Subject: kmalloc vs pci_alloc_consistent



I don't know the history behind pci_alloc and wanted to throw this out there
to get some clarification.

What's the benefit of pci_alloc over using kmalloc with flags for a
cache-safe buffer?


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kmalloc vs pci_alloc_consistent
  2003-07-18 14:56 kmalloc vs pci_alloc_consistent Johnson, Stephen
@ 2003-07-18 15:33 ` Chris Zimman
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Zimman @ 2003-07-18 15:33 UTC (permalink / raw)
  To: Johnson, Stephen; +Cc: linuxppc-embedded


On Fri, Jul 18, 2003 at 09:56:35AM -0500, Johnson, Stephen wrote:
> I read one thing noted on a man page for kmalloc that should be highlighted.
> "the GFP_DMA flag may be set to indicate the memory must be suitable for
> DMA. ***This can mean different things on different platforms.*** For
> example, on x86, it means that the memory must come from the first 16MB."

Just to clarify -- the 16MB lower memory limit is only true on x86 when doing
DMA via ISA.  PCI does not have this problem.

In addition to making sure you get pages that are usable for DMA,
pci_alloc_consistent() also takes care of cache coherency issues.

--Chris

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kmalloc vs pci_alloc_consistent
  2003-07-18 13:34 Johnson, Stephen
@ 2003-07-18 16:13 ` Matt Porter
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Porter @ 2003-07-18 16:13 UTC (permalink / raw)
  To: Johnson, Stephen; +Cc: linuxppc-embedded


On Fri, Jul 18, 2003 at 08:34:24AM -0500, Johnson, Stephen wrote:
>
> I don't know the history behind pci_alloc and wanted to throw this out there
> to get some clarification.
>
> What's the benefit of pci_alloc over using kmalloc with flags for a
> cache-safe buffer?

Documentation/DMA-mapping.txt has a detailed explanation of the API.

Regards,
--
Matt Porter
mporter@kernel.crashing.org

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* kmalloc vs pci_alloc_consistent
@ 2003-07-18 13:34 Johnson, Stephen
  2003-07-18 16:13 ` Matt Porter
  0 siblings, 1 reply; 4+ messages in thread
From: Johnson, Stephen @ 2003-07-18 13:34 UTC (permalink / raw)
  To: linuxppc-embedded


I don't know the history behind pci_alloc and wanted to throw this out there
to get some clarification.

What's the benefit of pci_alloc over using kmalloc with flags for a
cache-safe buffer?


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-18 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18 14:56 kmalloc vs pci_alloc_consistent Johnson, Stephen
2003-07-18 15:33 ` Chris Zimman
  -- strict thread matches above, loose matches on Subject: below --
2003-07-18 13:34 Johnson, Stephen
2003-07-18 16:13 ` Matt Porter

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.