Re: Preallocation of memory in 2.4 kernels

From: Alan Cox
Date: Fri Aug 13 2004 - 18:17:50 EST


On Gwe, 2004-08-13 at 19:11, chandrasekhar nagaraj wrote:
> 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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/