Re: [ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-13 Thread Alex Wang
On Thu, Aug 13, 2015 at 8:26 AM, Ilya Maximets wrote: > Ok, thanks for explanation. > In that case, I think, try-lock solution will be good. > > Best regards, Ilya Maximets. > Thx Ilya, for the suggestions and discussion I posted a patch here: http://openvswitch.org/pipermail/dev/2015-August/

Re: [ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-13 Thread Ilya Maximets
Ok, thanks for explanation. In that case, I think, try-lock solution will be good. Best regards, Ilya Maximets. On 12.08.2015 23:52, Alex Wang wrote: > Hey Ilya, > > Thanks for the reply please see my comments inline, > > Thanks, > Alex Wang, > > On Wed, Aug 12, 2015 at 4:19 AM, Ilya Maximets

Re: [ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-12 Thread Alex Wang
Hey Ilya, Thanks for the reply please see my comments inline, Thanks, Alex Wang, On Wed, Aug 12, 2015 at 4:19 AM, Ilya Maximets wrote: > I agree, that this solution is much more simple, but I don't like this > race for > coverage_mutex. > Why this all done so? > Before implementing pmd thread

Re: [ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-12 Thread Ilya Maximets
I agree, that this solution is much more simple, but I don't like this race for coverage_mutex. Why this all done so? I mean, why we should run coverage_clear every second? What if we change type of thread_local unsigned int counter_##COUNTER from unsigned int to unsigned long long and will call

Re: [ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-11 Thread Alex Wang
Just trying share an alternative, could we still do the coverage clear inside 'pmd_thread_main()'. However, instead of contending for the 'coverage_mutex', use 'ovs_mutex_trylock()'. Since pmd thread runs in infinite loop, it can constantly try grabbing the lock and will eventually acquire it. So

Re: [ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-11 Thread Alex Wang
Hi IIya, Thx a lot for writing up this fix, The reason that you did not see the pmd related coverage counter stats (in "ovs-appctl coverage/show") is that we do not call coverage_clear() anywhere in pmd_thread_main(). This is in that the coverage_clear() requires holding the global mutex in the

[ovs-dev] [PATCH RFC] coverage: fix coverage accounting for pmd threads

2015-08-10 Thread Ilya Maximets
Currently coverage_counter_register() is called only from constructor functions at program initialization time by main thread. Coverage counter values are static and thread local. This means, that all COVERAGE_INC() calls from pmd threads leads to increment of thread local variables of that thread