mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* isolated memory pools ?
@ 2003-05-14 16:35 Muthian Sivathanu
  2003-05-15 15:58 ` Ingo Oeser
  0 siblings, 1 reply; 3+ messages in thread
From: Muthian Sivathanu @ 2003-05-14 16:35 UTC (permalink / raw)
  To: linux-kernel

Hi,

Does anyone know if there is a simple way to manage
isolated memory pools in linux ?  I am writing a
device driver that does a lot of memory allocation to
keep track of some internal data structures. However,
when the system is subjected to an I/O intensive
workload for instance, the file system cache takes
away a lot of memory, leading to unpredictable delays
in memory allocation within my driver, which creates a
lot of performance problems.

Ideally, I would like to be able to allocate my own
memory pool, say, with 10% of the host memory, and
then have total control over it, i.e. the rest of the
kernel should not allocate from this space, and my
local free_pages should return memory back to my local
pool.  One obvious way to do this would be to pin
those pages to memory and then write my own memory
management routines to handle allocations within the
pool, but that seems time consuming and hard.  Is
there a way the existing kernel memory management
routines can be harnessed to manage
such an isolated free pool ?

Thanks,
Muthian.

P.S: Please CC my personal address in your replies
since I am not a member of
the mailing list.


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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

* Re: isolated memory pools ?
  2003-05-14 16:35 isolated memory pools ? Muthian Sivathanu
@ 2003-05-15 15:58 ` Ingo Oeser
  2003-05-15 19:35   ` Muthian Sivathanu
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Oeser @ 2003-05-15 15:58 UTC (permalink / raw)
  To: Muthian Sivathanu; +Cc: linux-kernel

Hi Muthian,

On Wed, May 14, 2003 at 09:35:58AM -0700, Muthian Sivathanu wrote:
> Ideally, I would like to be able to allocate my own
> memory pool, say, with 10% of the host memory, and
> then have total control over it, i.e. the rest of the
> kernel should not allocate from this space, and my
> local free_pages should return memory back to my local
> pool.  One obvious way to do this would be to pin
> those pages to memory and then write my own memory
> management routines to handle allocations within the
> pool, but that seems time consuming and hard.  Is
> there a way the existing kernel memory management
> routines can be harnessed to manage
> such an isolated free pool ?

#include <linux/mempool.h>

and look at the functions, which implement this.

linux/mm/mempool.c is the actual implementation.

This is not exactly, what you want (you CAN allocate more than
your 10% from this pool and the amount over your minimum number
of pages to be reserved is free for the kernel to use), but
should be what you really need.

Regards

Ingo Oeser


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

* Re: isolated memory pools ?
  2003-05-15 15:58 ` Ingo Oeser
@ 2003-05-15 19:35   ` Muthian Sivathanu
  0 siblings, 0 replies; 3+ messages in thread
From: Muthian Sivathanu @ 2003-05-15 19:35 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: linux-kernel

Hi Ingo,

Thanks!
I looked at the code,  but it seems to be meant for
fixed size objects.  I would like to have something
like a kmalloc interface to my memory pool since I
allocate a bunch of different kinds of structures. 
Any ideas how that can be done ?

thanks again,
Muthian.



--- Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
wrote:
> Hi Muthian,
> 
> On Wed, May 14, 2003 at 09:35:58AM -0700, Muthian
> Sivathanu wrote:
> > Ideally, I would like to be able to allocate my
> own
> > memory pool, say, with 10% of the host memory, and
> > then have total control over it, i.e. the rest of
> the
> > kernel should not allocate from this space, and my
> > local free_pages should return memory back to my
> local
> > pool.  One obvious way to do this would be to pin
> > those pages to memory and then write my own memory
> > management routines to handle allocations within
> the
> > pool, but that seems time consuming and hard.  Is
> > there a way the existing kernel memory management
> > routines can be harnessed to manage
> > such an isolated free pool ?
> 
> #include <linux/mempool.h>
> 
> and look at the functions, which implement this.
> 
> linux/mm/mempool.c is the actual implementation.
> 
> This is not exactly, what you want (you CAN allocate
> more than
> your 10% from this pool and the amount over your
> minimum number
> of pages to be reserved is free for the kernel to
> use), but
> should be what you really need.
> 
> Regards
> 
> Ingo Oeser
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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

end of thread, other threads:[~2003-05-15 19:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14 16:35 isolated memory pools ? Muthian Sivathanu
2003-05-15 15:58 ` Ingo Oeser
2003-05-15 19:35   ` Muthian Sivathanu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®