All of lore.kernel.org
 help / color / mirror / Atom feed
* Preallocation of memory in 2.4 kernels
@ 2004-08-13 18:11 chandrasekhar nagaraj
  2004-08-13 22:09 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: chandrasekhar nagaraj @ 2004-08-13 18:11 UTC (permalink / raw)
  To: linux-kernel

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!


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Preallocation of memory in 2.4 kernels
  2004-08-13 18:11 Preallocation of memory in 2.4 kernels chandrasekhar nagaraj
@ 2004-08-13 22:09 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2004-08-13 22:09 UTC (permalink / raw)
  To: chandrasekhar nagaraj; +Cc: Linux Kernel Mailing List

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-13 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13 18:11 Preallocation of memory in 2.4 kernels chandrasekhar nagaraj
2004-08-13 22:09 ` Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.