Re: [PATCH net-next] tuntap: introduce tx skb ring

Steven Rostedt
2016-05-18T11:52:13Z

On Wed, 18 May 2016 18:23:48 +0800
Jason Wang <jasowang@redhat.com> wrote:

>
> >
> >
> > Maybe Steven Rostedt have an even better ring queue implementation
> > already avail in the kernel?
> >
>
> You mean ring buffer in tracing? Not sure, but it looks rather complex
> at first glance.

Yes it is, and I'm not sure it would be appropriate here or not. The
tracing ring buffer is highly tuned to be lockless and per cpu
(allocates a buffer per cpu), it also does not need to disable
interrupts and can be used in NMI context.

The complexity comes from being able to locklessly swap out pages from
the ring buffer to send across the network or to disk while a record is
happening.

Perf has a simpler ring buffer made for mmapping, but it's still rather
coupled with the perf core. It would be nice to make that ring buffer a
bit more generic and not so tied to perf itself.

-- Steve