lkml.org 
[lkml]   [2018]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] IB/core: Make ib_mad_client_id atomic
From
Date
On Wed, 2018-04-18 at 16:24 +0200, Håkon Bugge wrote:
> Two kernel threads may get the same value for agent.hi_tid, if the
> agents are registered for different ports. As of now, this works, as
> the agent list is per port.
>
> It is however confusing and not future robust. Hence, making it
> atomic.
>

People sometimes underestimate the performance penalty of atomic ops.
Every atomic op is the equivalent of a spin_lock/spin_unlock pair. This
is why two atomics are worse than taking a spin_lock, doing what you
have to do, and releasing the spin_lock. Is this really what you want
for a "confusing, let's make it robust" issue?

--
Doug Ledford <dledford@redhat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-04-20 05:56    [W:0.090 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site