[dm-devel] [PATCH] dm.c : Per-device caches

Kevin Corry corryk at us.ibm.com
Mon Jan 13 12:34:02 UTC 2003


On Monday 13 January 2003 12:23, Joe Thornber wrote:
> On Mon, Jan 13, 2003 at 11:20:22AM -0600, Kevin Corry wrote:
> > On Monday 13 January 2003 11:50, Joe Thornber wrote:
> > > On Mon, Jan 13, 2003 at 10:04:15AM -0600, Kevin Corry wrote:
> > > > A change a few weeks ago introduced per-device mempools for dm_io
> > > > structures, but still used a global cache. This patch introduces
> > > > per-devices caches.
> > >
> > > This is pointless, or am I missing something ?
> >
> > Like I said, I'm not entirely sure. This is the way we did mempools in
> > EVMS, and there seem to be a couple other places that do this. But, there
> > really aren't too many mempool users in the kernel, so it's hard to find
> > examples of the best way to use them.
>
> The _io_cache is just an allocator, we're not using it as a cache at
> all (kmem_cache_t is a bad name IMO).  When we create the mempool
> the mempool pre-allocates a set of the io object from the allocator.
> There is no reason why different slab allocators need to be used,
> unless you are allocating object of differing sizes.

Ah, yes. Looking back at the scsi and bio code, the size of the cache objects 
does seem to be the differentiating factor.

Well, good to know. :)

-- 
Kevin Corry
corryk at us.ibm.com
http://evms.sourceforge.net/




More information about the dm-devel mailing list