[ovs-dev] [dpif-netdev 05/15] dpif-netdev: Use new "ovsthread_counter" to track dp statistics.

Ben Pfaff blp at nicira.com
Mon Dec 30 18:49:33 UTC 2013


On Mon, Dec 30, 2013 at 10:40:13AM -0800, Pravin Shelar wrote:
> On Fri, Dec 27, 2013 at 8:03 PM, Ben Pfaff <blp at nicira.com> wrote:
> > ovsthread_counter is an abstract interface that could be implemented
> > different ways.  The initial implementation is simple but less than
> > optimally efficient.
> >
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > +void
> > +ovsthread_counter_inc(struct ovsthread_counter *c, unsigned long long int n)
> > +{
> > +    c = &c[hash_int(ovsthread_id_self(), 0) % N_COUNTERS];
> > +
> Does it make sense optimize this locking so that threads running on
> same numa-node likely share lock?
> we can use process id hashing to achieve it easily.

Yes, that makes a lot of sense.  How do we do it?

Thanks,

Ben.



More information about the dev mailing list