the cost of vmalloc

Zheng Da zhengda1936 at gmail.com
Fri Sep 9 21:16:01 EDT 2011


Hello,

I need to allocate fairly a large piece of memory, about 128KB or
256KB. I tried to use kmalloc, and it sometimes fails, but vmalloc in
this case usually still work.
But I'm not sure how costly vmalloc is. As far as I know, vmalloc
needs to change the page table, and thus might need to invalidate TLB.
It seems quite expensive. If it is, maybe I can allocate memory with
kmalloc first, and then try to use vmalloc if kmalloc fails. Any
suggestions?

Thanks,
Da



More information about the Kernelnewbies mailing list