Re: [PATCH 2/5] vmbus: implement lock-less ring buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 22 May 2017 11:28:18 -0700
Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx> wrote:

> 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.

I will make a new version with locks, but uses the simplified memcpy code.
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux