[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55EA0172.2040505@gmail.com>
Date: Fri, 4 Sep 2015 13:39:14 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: Christoph Lameter <cl@...ux.com>
Cc: Jesper Dangaard Brouer <brouer@...hat.com>, netdev@...r.kernel.org,
akpm@...ux-foundation.org, linux-mm@...ck.org,
aravinda@...ux.vnet.ibm.com,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
iamjoonsoo.kim@....com
Subject: Re: [RFC PATCH 0/3] Network stack, first user of SLAB/kmem_cache bulk
free API.
On 09/04/2015 11:55 AM, Christoph Lameter wrote:
> On Fri, 4 Sep 2015, Alexander Duyck wrote:
>
>> were to create a per-cpu pool for skbs that could be freed and allocated in
>> NAPI context. So for example we already have napi_alloc_skb, why not just add
>> a napi_free_skb and then make the array of objects to be freed part of a pool
>> that could be used for either allocation or freeing? If the pool runs empty
>> you just allocate something like 8 or 16 new skb heads, and if you fill it you
>> just free half of the list?
> The slab allocators provide something like a per cpu pool for you to
> optimize object alloc and free.
Right, but one of the reasons for Jesper to implement the bulk
alloc/free is to avoid the cmpxchg that is being used to get stuff into
or off of the per cpu lists.
In the case of network drivers they are running in softirq context
almost exclusively. As such it is useful to have a set of buffers that
can be acquired or freed from this context without the need to use any
synchronization primitives. Then once the softirq context ends then we
can free up some or all of the resources back to the slab allocator.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists