Page MenuHomeFreeBSD

Reduce contention on per-adapter lock.

Authored by jhb on Thu, Jun 25, 9:24 PM.


  • Move temporary sglists into the session structure and protect them with a per-session lock instead of a per-adapter lock.
  • Retire an unused session field, and move a debugging field under INVARIANTS to avoid using the session lock for completion handling when INVARIANTS isn't enabled.
  • Use counter_u64 for per-adapter statistics.

Note that this helps for cases where multiple sessions are used
(e.g. multiple IPsec SAs or multiple KTLS connections). It does not
help for workloads that use a single session (e.g. a single GELI

Test Plan
  • tested with KTLS RX where it made a marginal perf improvement (29 Gbps to 30-31 Gbps). However, in pmcstat callchains, lock_delay due to lock contention went from 6% of overall time (of which 82% was for the adapter lock in ccr_process) to 3% of overall time (of which 3% was for the per-session lock in ccr_process)

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Thu, Jun 25, 9:24 PM
jhb requested review of this revision.Thu, Jun 25, 9:24 PM
np accepted this revision.Thu, Jun 25, 11:28 PM
This revision is now accepted and ready to land.Thu, Jun 25, 11:28 PM
This revision was automatically updated to reflect the committed changes.