Re: [RFC v4 0/3] lib/fastmem: fast small-object allocator

Bruce Richardson <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
On Mon, Aug 10, 2026 at 06:09:59PM +0200, Morten Brørup wrote:
> > 3. Per-lcore caches: bounded LIFO stacks (no locks on the hot
> >    path). Cache misses trigger bulk transfers to/from the shared
> >    bin under a spinlock.
> 
> I haven't looked at the v4 code in detail, so forgive me if my concern is already addressed.
> 
> I am worried that a non-EAL thread can be preempted while holding a fastmem lock.
> Could this cause an EAL thread to stall in the fastmem lib under the wrong circumstances?
> If so, can this be avoided in any way?
> 
> The Lock-Free Stack has a solution using single-linked lists and a 128-bit CAS operation.
> The solution is quite slow (due to linked list traversal with retry on collision), but progress is practically guaranteed.
> 
This is an issue with many DPDK libraries, even rings and most mempool
implementations. I think it's up to the app developer to ensure that
preemption of non-EAL threads does not cause data-plane issues.

/Bruce
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.