On Mon, 22 May 2017 11:28:18 -0700 Stephen Hemminger <step...@networkplumber.org> wrote:
> On Sun, 21 May 2017 18:09:59 +0000 > KY Srinivasan <k...@microsoft.com> wrote: > > > > -----Original Message----- > > > From: Stephen Hemminger [mailto:step...@networkplumber.org] > > > Sent: Thursday, May 18, 2017 9:25 AM > > > To: KY Srinivasan <k...@microsoft.com>; gre...@linuxfoundation.org > > > Cc: de...@linuxdriverproject.org; Stephen Hemminger > > > <sthem...@microsoft.com> > > > Subject: [PATCH 2/5] vmbus: implement lock-less ring buffer > > > > > > Use a reservation similar to ftrace to make vmbus ring buffer writes > > > lock free. > > > > > > The algorithm uses cmpxchg to atomically reserve an area in the ring > > > buffer. Then the data is copied into the ring, and the updates to the > > > head of the ring are ordered. > > > > > > Other similar implementions are FreeBSD buf_ring, and DPDK rte_ring. > > > > > > Signed-off-by: Stephen Hemminger <sthem...@microsoft.com> > > > I did some detailed measurements. The locked version takes 89.8ns average to > write to > ring buffer, and the cmpxchg version takes 94.7ns. The difference is that > the locked > version has longer tail of distribution. Some most common for both cases is > 80ns. > > Let's skip this patch. I will make a new version with locks, but uses the simplified memcpy code. _______________________________________________ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel