On Fri, 27 Jan 2017 16:01:37 -0800
Stephen Hemminger <step...@networkplumber.org> wrote:

> On Fri, 27 Jan 2017 18:08:35 +0000
> KY Srinivasan <k...@microsoft.com> wrote:
> 
> > > -----Original Message-----
> > > From: Stephen Hemminger [mailto:step...@networkplumber.org]
> > > Sent: Monday, January 23, 2017 5:40 PM
> > > To: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang
> > > <haiya...@microsoft.com>
> > > Cc: de...@linuxdriverproject.org; Stephen Hemminger
> > > <sthem...@microsoft.com>
> > > Subject: [PATCH 07/14] vmbus: remove conditional locking of vmbus_write
> > > 
> > > All current usage of vmbus write uses the acquire_lock flag, therefore
> > > having it be optional is unnecessary. This also fixes a sparse warning
> > > since sparse doesn't like when a function has conditional locking.    
> > 
> > In order to avoid cross-tree dependency, I got this functionality into 
> > Greg's
> > tree first. I plan to submit patches to netvsc that will use this 
> > functionality.
> > As you know, we hold a higher level lock in the protocol stack when we send 
> > on
> > a sub-channel. This will avoid an unnecessary spin lock round trip in the 
> > data path.
> > 
> > Regards,
> > 
> > K. Y
> >  
> 
> The following (untested) changes VMBUS ring buffer to use a lockless update 
> policy.
> 
> From b4a0ff829fe617aacb5bcea44eb473692f1180d2 Mon Sep 17 00:00:00 2001
> From: Stephen Hemminger <sthem...@microsoft.com>
> Date: Fri, 27 Jan 2017 15:46:48 -0800
> Subject: [PATCH] vmbus: implement lock-less ring buffer
> 
> Use a reservation similar to ftrace to make vmbus ring buffer writes
> lock free. Other similar implementions are FreeBSD buf_ring, and DPDK
> rte_ring.
> 
> 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.
> 
> Signed-off-by: Stephen Hemminger <sthem...@microsoft.com>

For a description of how this works see: 
 http://dpdk.org/doc/guides/prog_guide/ring_lib.html
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to