FreeBSD/src 1647376 (r332821)sys/netinet in_pcb.c, sys/netinet6 in6_pcb.c

MFC r331309:
  If the INP lock is uncontested, avoid taking a reference and jumping
  through the lock-switching hoops.

  A few of the INP lookup operations that lock INPs after the lookup do
  so using this mechanism (to maintain lock ordering):

  1. Lock lookup structure.
  2. Find INP.
  3. Acquire reference on INP.
  4. Drop lock on lookup structure.
  5. Acquire INP lock.
  6. Drop reference on INP.

  This change provides a slightly shorter path for cases where the INP
  lock is uncontested:

  1. Lock lookup structure.
  2. Find INP.
  3. Try to acquire the INP lock.
  4. If successful, drop lock on lookup structure.

  Of course, if the INP lock is contested, the functions will need to
  revert to the previous way of switching locks safely.

  This saves a few atomic operations when the INP lock is uncontested.

Sponsored by:   Netflix, Inc.
DeltaFile
+52-22sys/netinet/in_pcb.c
+52-22sys/netinet6/in6_pcb.c
+104-442 files

UnifiedSplitRaw