On Sun, 21 May 2017 18:09:59 +0000 KY Srinivasan <kys@xxxxxxxxxxxxx> wrote: > > -----Original Message----- > > From: Stephen Hemminger [mailto:stephen@xxxxxxxxxxxxxxxxxx] > > Sent: Thursday, May 18, 2017 9:25 AM > > To: KY Srinivasan <kys@xxxxxxxxxxxxx>; gregkh@xxxxxxxxxxxxxxxxxxx > > Cc: devel@xxxxxxxxxxxxxxxxxxxxxx; Stephen Hemminger > > <sthemmin@xxxxxxxxxxxxx> > > 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 <sthemmin@xxxxxxxxxxxxx> 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. _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel