[ovs-dev] [PATCH 2/2] ofproto/bond: Protect statistics with a mutex.

Andy Zhou azhou at nicira.com
Mon Apr 14 13:26:18 UTC 2014


On Mon, Apr 14, 2014 at 2:43 AM, Joe Stringer <joe at wand.net.nz> wrote:
> On 14 April 2014 21:04, Andy Zhou <azhou at nicira.com> wrote:
>>
>> > Looking closer, there are two things that this patch achieves:
>> > (1) Allow statistics to be attributed to two different bonds at the same
>> > time.
>> If this is the goal, should we also consider each bond have its own
>> read/write lock?
>
> If reading/writing to bond state is frequent for data other than statistics,
> sure. I'm not sure we need to go that far at this stage.
>
>> > (2) Reduce the critical section for threads that attribute stats to the
>> > same
>> > bond.
>> If this is the goal, should the bond_account() take a read lock
>> instead of write lock?
>
> Yes, I'll fix this up.
>
>> FWIW, it won't be a problem with bond mega flow, since the stats will
>> be attributed to
>> the 'hidden rules' of each post recirculation rules, bond code then
>> read them from
>> the post recirculation rules in the main thread.
>>
>> Your change should still help when megaflow or recirculation
>> are not enabled, although not the common case I measure.
>
> I see. Is the existing bond_account() codepath ever used if bond megaflow is
> enabled?
In theory, yes, for attributing stats to the recirc flow.  There is a
bug in current code.
I will post a fix soon.
>
> I'll post a v2.
Thanks,



More information about the dev mailing list