tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Question about atomic FIFO/LIFO queues



Hi Taylor,

Thanks for you response! Do I understand correctly that you basically already have some lockless FIFO queue (in subr_pcq.c), is it correct?

Please let me know if there is any interest for our FIFO queue anywhere else in the codebase, not necessarily networking.

Ruslan

On 9/27/20 2:58 PM, Taylor R Campbell wrote:
Date: Fri, 25 Sep 2020 17:58:41 -0400
From: Ruslan Nikolaev <nruslan_devel%yahoo.com@localhost>

I came across this page
https://wiki.netbsd.org/projects/project/atomic_fifo_lifo_queues/

Recently, we have designed a high-performant (and what is also very
important -- truly lock-free -- not just "lockless") and memory
efficient FIFO queue based on ring buffers that use FAA (fetch-and-add)
and traditional M&S queue as an outer layer (for unbounded queues).

Cool!

I don't actually know what the author of that project description had
in mind, and he's no longer around, so we should probably just take
that page down unless someone else remembers and it's still relevant.
Parts of the network stack use pcq(9) for inter-CPU packet queueing,
although in new code (and incrementally for old code) we generally try
to minimize inter-CPU communication except to distribute load.

https://man.NetBSD.org/pcq.9
https://nxr.NetBSD.org/xref/src/sys/kern/subr_pcq.c




Home | Main Index | Thread Index | Old Index