Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Dec 2013 01:41:39 -0500
From:      Ryan Stone <rysto32@gmail.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: buf_ring in HEAD is racy
Message-ID:  <CAFMmRNyPKWt4psvXoJ%2BrwrX1R%2Bu1oM8EBbK%2BbG6JzU%2BVZrEXng@mail.gmail.com>
In-Reply-To: <CAJ-Vmo=7DWgBFB=j2_qsFM3YwgO56LETjGXuAYaiaicMMqL19Q@mail.gmail.com>
References:  <CAFMmRNyJpvZ0AewWr62w16=qKer%2BFNXUJJy0Qc=EBqMnUV3OyQ@mail.gmail.com> <CAJ-Vmo=7DWgBFB=j2_qsFM3YwgO56LETjGXuAYaiaicMMqL19Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Dec 14, 2013 at 7:08 PM, Adrian Chadd <adrian@freebsd.org> wrote:
> Honestly, we could just do with a generic multi-writer, single-reader
> ring type that we can re-use for other things, rather than just mbufs.

That is actually exactly what buf_ring is -- it deals with void *, not
struct mbuf *.

> We could also have the code run in userland and do some very in-depth
> stress testing of it there rather than needing it to be in the kernel.

For testing purposes this isn't very hard -- I did it yesterday while
debugging this problem. The one trick is that buf_ring uses
critical_enter/critical_exit to prevent livelock (which was woefully
undocumented in the code) so when I was testing I had to make sure
that I didn't have more threads than cores.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNyPKWt4psvXoJ%2BrwrX1R%2Bu1oM8EBbK%2BbG6JzU%2BVZrEXng>