LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-11-2011, 10:45 AM   #1
lorizhuang
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
vmalloc or kmalloc for 16k memory space


I'm writing a device driver. When the device is going to be suspended, the driver allocates a 16k memory space. When the device is going to be resumed, the driver frees this memory space. The suspend/resume may happen quite often. My problem is whether to use vmalloc or kmalloc for this allocation. kmalloc is faster, but I'm worried about that frequently allocating & releasing a 16k memory space easily leads to a failure in allocation. vmalloc doesn't have this problem, but it's not as efficient as kmalloc.
 
Old 06-13-2011, 02:21 PM   #2
nini09
Member
 
Registered: Apr 2009
Posts: 981

Rep: Reputation: 67
For 16k memory, do you use it for hardware operation? If not, vmalloc should be Ok.
 
Old 06-14-2011, 03:33 AM   #3
lorizhuang
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Original Poster
Rep: Reputation: 0
No hardware operation, but vmalloc is expensive, it has to setup page tables.
 
Old 06-14-2011, 02:26 PM   #4
nini09
Member
 
Registered: Apr 2009
Posts: 981

Rep: Reputation: 67
You can use mempool to avoid frequently allocating & releasing physically. The pool always hold the memory even if the memory is freed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
out of vmalloc space DebianUser Linux - Kernel 1 02-24-2011 02:29 PM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
[SOLVED] Find Physical address of memory provided by kmalloc raghu2383 Programming 3 10-23-2009 02:25 PM
Sharing Memory between driver space and user space ian b davidson Programming 1 11-10-2008 06:35 AM
How to increase vmalloc space size in the kernel 2.6.11.4? gavin_guo Linux - Kernel 1 05-21-2006 09:23 AM


All times are GMT -5. The time now is 02:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration