HomeFreeBSD

tcp: use CALLOUT_TRYLOCK for the TCP callout

Description

tcp: use CALLOUT_TRYLOCK for the TCP callout

This allows to remove the drop of the lock tcp_timer_enter(), which closes
a sophisticated but possible race that involves three threads. In case we
got a callout executing and two threads trying to close the connection,
e.g. and interrupt and a syscall, then lock yielding in tcp_timer_enter()
may transfer lock from one closing thread to the other closing thread,
instead of the callout.

Reviewed by: jtl
Differential Revision: https://reviews.freebsd.org/D45747

Details

Provenance
glebiusAuthored on Thu, Oct 24, 4:58 PM
Reviewer
jtl
Differential Revision
D45747: tcp: use CALLOUT_TRYLOCK for the TCP callout
Parents
rGefcb2ec8cb81: callout: provide CALLOUT_TRYLOCK flag
Branches
Unknown
Tags
Unknown