aboutsummaryrefslogtreecommitdiff
path: root/contrib/perl5/pod/ssh:/anongit@git.FreeBSD.org/(public-mirror)
diff options
context:
space:
mode:
authorAndrew Gallatin <gallatin@FreeBSD.org>2026-01-07 19:29:53 +0000
committerAndrew Gallatin <gallatin@FreeBSD.org>2026-01-07 19:32:08 +0000
commit14d93f612f26f4e8454e393b75b0e4be0fc9d890 (patch)
treee95daca57b575b97aee6b5f79535fa5a66428ed0 /contrib/perl5/pod/ssh:/anongit@git.FreeBSD.org/(public-mirror)
parente30086ab4c8778ea70a3b19e83546ce1b4a16492 (diff)
iflib: Drop tx lock when freeing mbufs using simple_transmitHEADmain
Freeing completed transmit mbufs can be time consuming (due to them being cold in cache, and due to ext free routines taking locks), especially when we batch tx completions. If we do this when holding the tx ring mutex, this can cause lock contention on the tx ring mutex when using iflib_simple_transmit. To resolve this, this patch opportunistically copies completed mbuf pointers into a new array (ifsd_m_defer) so they can be freed after dropping the transmit mutex. The ifsd_m_defer array is opportunistically used, and may be NULL. If its NULL, then we free mbufs in the old way. The ifsd_m_defer array is atomically nulled when a thread is using it, and atomically restored when the freeing thread is done with it. The use of atomics here avoids acquire/release of the tx lock to restore the array after freeing mbufs. Since we're no longer always freeing mbufs inline, peeking into them to see if a transmit used TSO or not will cause a useless cache miss, as nothing else in the mbuf is likely to be accessed soon. To avoid that cache miss, we encode a TSO or not TSO flag in the lower bits of the mbuf pointer stored in the ifsd_m array. Note that the IFLIB_NO_TSO flag exists primarily for sanity/debugging. iflib_completed_tx_reclaim() was refactored to break out iflib_txq_can_reclaim() and _iflib_completed_tx_reclaim() so the that the tx routine can call iflib_tx_credits_update() just once, rather than twice. Note that deferred mbuf freeing is not enabled by default, and can be enabled using the dev.$DEV.$UNIT.iflib.tx_defer_mfree sysctl. Differential Revision: https://reviews.freebsd.org/D54356 Sponsored by: Netflix Reviewed by: markj, kbowling, ziaee
Diffstat (limited to 'contrib/perl5/pod/ssh:/anongit@git.FreeBSD.org/(public-mirror)')
0 files changed, 0 insertions, 0 deletions