Re: allocate large region of memory in kernel space?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm working on a module that needs to allocate a large region of memory. I know that in this case I should use vmalloc(). The problem is the size of memory allocation for vmalloc() is 128MB maximally, but I need to allocate more than that.

Why? Why do you need so much memory allocated in one shot?

Do I have to use a array to hold a number of small regions of memory?

What is the largest physically continuous memory the kmalloc() can allocate?

AFAIK, that depends on the memory fragmentation. If there's contiguous memory available, kmalloc should be able to allocate it for you (barring the size restrictions). The sizes are defined in kmalloc_sizes.h. You can try the CONFIG_LARGE_ALLOCS to support bigger allocations.

Fei

--
Pradeep Padala
http://ppadala.blogspot.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux