Preallocation of memory in 2.4 kernels
Hi,
We have a block driver which operates under heavy IO load.The driver
always preallocates the memory for IO so that while IO is going ,it can take the required memory from the pool.(for performance reasons,we preallocate the memory).
But we do have some small chunks of memory allocation (say close to 4K) when the IO is in operation.(to update the stats,we require this memory).But under heavy load conditions,the kmalloc fails to get even this small chunk of data. We felt that we could preallocate some 64K of memory pool(before the IO starts) and then when this kind of small memory request comes (note that this request size is variable) , we would use this memory pool instead of using the kmalloc. Is there any mechanism in 2.4 kernels to achieve this task.?
Regards
Chandrasekhar
_________________________________________________________________
Block annoying pop ups! Empower your search! http://server1.msn.co.in/features04/general/MSNToolbar Enrich your internet experience!
Quoted 5 lines · chandrasekhar nagaraj
We felt that we could preallocate some 64K of memory pool(before the IO starts) and then when this kind of small memory request comes (note that this request size is variable) , we would use this memory pool instead of using the kmalloc.
Is there any mechanism in 2.4 kernels to achieve this task.?
Yes - use kmalloc or multiple kmallocs before the I/O starts (eg allocate in the driver startup). 2.6.x has a nice structure for doing this and helpers but for the general case drivers just preallocate buffers to be sure they can make progress. It's normally the most efficient solution anyway.