On Mon, 22 May 2017 11:28:18 -0700 Stephen Hemminger <[email protected]> wrote:
> On Sun, 21 May 2017 18:09:59 +0000 > KY Srinivasan <[email protected]> wrote: > > > > -----Original Message----- > > > From: Stephen Hemminger [mailto:[email protected]] > > > Sent: Thursday, May 18, 2017 9:25 AM > > > To: KY Srinivasan <[email protected]>; [email protected] > > > Cc: [email protected]; Stephen Hemminger > > > <[email protected]> > > > 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 <[email protected]> > > > 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 [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
