[ovs-dev] [PATCH v3] dpif-netdev: Remove PMD latency on seq_mutex

Jarno Rajahalme jarno at ovn.org
Mon Jul 4 10:48:30 UTC 2016


> On Jun 29, 2016, at 4:58 PM, Flavio Leitner <fbl at redhat.com> wrote:
> 
> On Wed, Jun 29, 2016 at 05:04:06AM -0700, Jarno Rajahalme wrote:
>> 
>>> On Jun 23, 2016, at 11:40 AM, Flavio Leitner <fbl at redhat.com> wrote:
>>> 
...
> 
>>> +
>>> +    ovs_assert(!single_threaded());
>>> +    perthread = ovsrcu_perthread_get();
>> 
>> Is there a particular reason not to do also these only when the locking succeeds? E.g., 
> 
> The reason was to not hold the lock more than needed even
> though the above lines should be fast enough today. Are you
> saying that the code looks significantly better if we try
> locking first at the beginning?

I guess in addition to aesthetics my thinking was not to do unnecessary things if the locking does not succeed, but your design argument is better, especially when we expect the locking to succeed most of the time.

  Jarno




More information about the dev mailing list