lorizhuang |
06-11-2011 10:45 AM |
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.
|