Page MenuHomeFreeBSD

tcp_hpts: rewrite inpcb synchronization
ClosedPublic

Authored by glebius on Nov 16 2021, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 4:05 PM
Unknown Object (File)
Mon, Nov 4, 10:50 PM
Unknown Object (File)
Sun, Oct 20, 8:49 AM
Unknown Object (File)
Sun, Oct 20, 8:49 AM
Unknown Object (File)
Sun, Oct 20, 8:49 AM
Unknown Object (File)
Sun, Oct 20, 8:49 AM
Unknown Object (File)
Sun, Oct 20, 8:18 AM
Unknown Object (File)
Oct 15 2024, 2:03 AM
Subscribers

Details

Summary

Just trust the pcb database, that if we did in_pcbref(), no way
an inpcb can go away. And if we never put a dropped inpcb on
our queue, and tcp_discardcb() always removes an inpcb to be
dropped from the queue, then any inpcb on the queue is valid.

Now, to solve LOR between inpcb lock and HPTS queue lock do the
following trick. When we are about to process a certain time
slot, take the full queue of the head list into on stack list,
drop the HPTS lock and work on our queue. This of course opens
a race when an inpcb is being removed from the on stack queue,
which was already mentioned in comments. To address this race
introduce generation count into queues. If we want to remove
an inpcb with generation count mismatch, we can't do that, we
can only mark it with desired new time slot or -1 for remove.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42884
Build 39772: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Nov 17 2021, 7:22 PM
This revision now requires review to proceed.Nov 19 2021, 4:41 AM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 2 2021, 6:52 PM
This revision was automatically updated to reflect the committed changes.