[ovs-dev] [PATCH] datapath: Use u64_stats_sync for datapath and vport stats.

Jesse Gross jesse at nicira.com
Mon Nov 21 18:23:06 UTC 2011


On Mon, Nov 21, 2011 at 9:49 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Sat, Nov 19, 2011 at 10:20:24AM -0800, Jesse Gross wrote:
>> We currently use a seqcount to prevent reading partial 64-bit stats
>> on 32-bit CPUs.  u64_stats_sync uses the same logic but elides it on
>> 64-bit and uniprocessor machines.  This improves performance (primarily
>> on non-x86 architectures) at the cost of not guaranteeing that packet
>> and byte counts were necessarily read together.
>>
>> Suggested-by: Stephen Hemminger <shemminger at vyatta.com>
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>
> Acked-by: Ben Pfaff <blp at nicira.com>
>
> (These acks are going to look silly going upstream, maybe we should
> switch to "Looks good." for the datapath :-)

These patches will get squashed before I send another round upstream,
so it won't show up.  I suppose we can solve the problem when we get
to it...

> I don't see anything that documents how one initializes a
> u64_stats_sync.  I guess all-zero-bits initialization is sufficient,
> and it looks like percpu data is initially zeroed.

Both of those statements are true so it's definitely correct.  I don't
think that there's an "official" way to initialize it though.



More information about the dev mailing list