Skip to contentSkip to conversation

Memory allocation from ZONE_HIGHMEM ???

DISCUSSION Pintu Agarwal 2 participants 2 messages Jul 14, 2011 Memory management

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line · Pintu Agarwal

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

kmalloc does not allocate from ZONE_HIGHMEM.

Quoted 2 lines

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.