linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Memory allocation from ZONE_HIGHMEM ???
@ 2011-07-14  6:45 Pintu Agarwal
  2011-07-14 19:34 ` Christoph Lameter
  0 siblings, 1 reply; 2+ messages in thread
From: Pintu Agarwal @ 2011-07-14  6:45 UTC (permalink / raw)
  To: Linux-MM, LKML

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

Hi,
 
I have a question regarding kernel memory allocation(using kmalloc) from ZONE_HIGHMEM zone.
 
I have a custom linux kernel2.6.36 running on linux mobile (arm cortexA9)
I have two zones on my system as shown by buddyinfo.
=====================================================
/opt/home/root # cat /proc/buddyinfo
Node 0, zone   Normal      2     32     22     14     12      4     12      3      0      1     23
Node 0, zone  HighMem    529    243    114     43     25     23     19     19     16     14     27
=====================================================
 
When I do memory allocation using kmalloc, the pages are allocated from Normal zone.
My allocation size is for order-10 pages = 23 * 1024 * PAGE_SIZE = 80MB
If I use more than that my allocation will fail which is obvious.
 
But I want to specifically allocate pages from ZONE_HIGHMEM instead of Normal zone.
How to explicitly do that in kernel?
 
If somebody have tried this please let me know.
 
 
 
Thanks, Regards,
Pintu

[-- Attachment #2: Type: text/html, Size: 2537 bytes --]

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

* Re: Memory allocation from ZONE_HIGHMEM ???
  2011-07-14  6:45 Memory allocation from ZONE_HIGHMEM ??? Pintu Agarwal
@ 2011-07-14 19:34 ` Christoph Lameter
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Lameter @ 2011-07-14 19:34 UTC (permalink / raw)
  To: Pintu Agarwal; +Cc: Linux-MM, LKML

[-- Attachment #1: Type: TEXT/PLAIN, Size: 481 bytes --]

On Wed, 13 Jul 2011, Pintu Agarwal wrote:

> I have a question regarding kernel memory allocation(using kmalloc) from ZONE_HIGHMEM zone.

kmalloc does not allocate from ZONE_HIGHMEM.

> But I want to specifically allocate pages from ZONE_HIGHMEM instead of Normal zone.
> How to explicitly do that in kernel?

You must use the page allocator. The slab allocators cannot use
ZONE_HIGHMEM. ZONE_HIGHMEM contains pages that are not directly accessible
from the processor.

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

end of thread, other threads:[~2011-07-14 19:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14  6:45 Memory allocation from ZONE_HIGHMEM ??? Pintu Agarwal
2011-07-14 19:34 ` Christoph Lameter

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