lkml.org 
[lkml]   [2016]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC 1/2] scatterlist: add mempool based chained SG alloc/free api
From
Date
On Wed, 2016-03-16 at 09:23 +0100, Christoph Hellwig wrote:
> > 
> We can defintively kill this one.

We want to support different size of pools.
How can we kill this one?

Or did you mean we just create a single pool with size SG_CHUNK_SIZE?

>
> > +static __init int sg_mempool_init(void)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < SG_MEMPOOL_NR; i++) {
> > + struct sg_mempool *sgp = sg_pools + i;
> > + int size = sgp->size * sizeof(struct scatterlist);
> > +
> > + sgp->slab = kmem_cache_create(sgp->name, size, 0,
> > + SLAB_HWCACHE_ALIGN, NULL);
>
> Having these mempoools around in every kernel will make some embedded
> developers rather unhappy.  We could either not create them at
> runtime, which would require either a check in the fast path, or
> an init call in every driver, or just move the functions you
> added into a separe file, which will be compiled only based on a
> Kconfig
> symbol, and could even be potentially modular.  I think that
> second option might be easier.

I created lib/sg_pool.c with CONFIG_SG_POOL.

\
 
 \ /
  Last update: 2016-03-21 08:41    [W:0.079 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site