mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to guarantee that kmalloc returns an address below 4GB
@ 2007-05-16  8:30 Cestonaro, Thilo (external)
  2007-05-16 13:11 ` Stefan Richter
  0 siblings, 1 reply; 3+ messages in thread
From: Cestonaro, Thilo (external) @ 2007-05-16  8:30 UTC (permalink / raw)
  To: linux-kernel

Hey,

is there an option for kmalloc, which I can use to allocate a buffer which is in physical memory placed below 4GB?
Not in a remapped area.
The only way I found is to use GFP_DMA, but this says the first 16MB isn't it?

Ciao Thilo

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

* Re: How to guarantee that kmalloc returns an address below 4GB
  2007-05-16  8:30 How to guarantee that kmalloc returns an address below 4GB Cestonaro, Thilo (external)
@ 2007-05-16 13:11 ` Stefan Richter
  2007-05-17 18:46   ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Richter @ 2007-05-16 13:11 UTC (permalink / raw)
  To: Cestonaro, Thilo (external); +Cc: linux-kernel

Cestonaro, Thilo (external) wrote:
> is there an option for kmalloc, which I can use to allocate
> a buffer which is in physical memory placed below 4GB?
> Not in a remapped area.

GFP_DMA32
http://lxr.linux.no/source/include/linux/gfp.h#L82
-- 
Stefan Richter
-=====-=-=== -=-= =----
http://arcgraph.de/sr/

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

* Re: How to guarantee that kmalloc returns an address below 4GB
  2007-05-16 13:11 ` Stefan Richter
@ 2007-05-17 18:46   ` Christoph Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2007-05-17 18:46 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Cestonaro, Thilo (external), linux-kernel

On Wed, 16 May 2007, Stefan Richter wrote:

> Cestonaro, Thilo (external) wrote:
> > is there an option for kmalloc, which I can use to allocate
> > a buffer which is in physical memory placed below 4GB?
> > Not in a remapped area.
> 
> GFP_DMA32

Nope. There are no general slabs available for DMA32.

You could use a dma slab by specifying GFP_DMA. However, on i386 and 
x86_64 this will get you memory in the precious first 16MB. On IA64 and 
other platforms you will get memory < 4GB.

Another option is to use the page allocator and specify GFP_DMA32.


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

end of thread, other threads:[~2007-05-17 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-16  8:30 How to guarantee that kmalloc returns an address below 4GB Cestonaro, Thilo (external)
2007-05-16 13:11 ` Stefan Richter
2007-05-17 18:46   ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®