use of V_tcbinfo lock for TCP syncache

Vijay Singh vijju.singh at gmail.com
Wed Dec 19 22:06:07 UTC 2012


>> Holding the pcbinfo lock prevents races between syncache_socket() and
>> accept().  See rwatson's comment just above tcp_usr_accept.  I noted
>> this too (the comment above tod->tod_offload_socket() in tcp_syncache.c)
>> back when I updated the TOE code in the kernel.
>
> er, I think I told you why tcp_usr_accept holds the pcbinfo lock, which
> wasn't your original question... :-)

But it helped.

So I am thinking about trying a change where syncache_socket() would
call soalloc() first, get a socket, setup the inp, and then do a
(modified) sonewconn to place the socket in the listener's queue.
Robert's comment indicated that this would be a better way to
eliminate the race since we wouldn't need the pcblock when we make the
sonewconn call.

-vijay


More information about the freebsd-net mailing list