Messages in this thread | | | Subject | Re: [PATCH] IB/core: Make ib_mad_client_id atomic | From | Doug Ledford <> | Date | Thu, 19 Apr 2018 23:55:55 -0400 |
| |
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] | |