Date: Wed, 19 Dec 2012 11:31:01 -0800 From: Vijay Singh <vijju.singh@gmail.com> To: freebsd-net@freebsd.org Subject: use of V_tcbinfo lock for TCP syncache Message-ID: <CALCNsJRFyQ9ZmfJ3quX2-cUuFHjs2rXw63Tq5ZH-uP1%2BoQmjLw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
As it is today, a socket upcall on a listener socket is made with the
V_tcbinfo lock held. [tcp_input -> syncache_socket -> sonewconn ->
sowakeup].
I feel that the use of the V_tcbinfo is not consistent in the syncache code.
In syncache_add(), we drop the lock before doing the lookup:
        INP_WUNLOCK(inp);
        INP_INFO_WUNLOCK(&V_tcbinfo);
        [..snip..]
        sc = syncache_lookup(inc, &sch);        /* returns locked entry */
However, when going through syncache_expand() or syncache_chkrst() we
keep the V_tcbinfo lock.
Since the syncache has its own lock, do we need to hold the V_tcbinfo
lock when calling syncache_socket()?
If there are ideas, or patches, I can give them a try.
-vijay
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALCNsJRFyQ9ZmfJ3quX2-cUuFHjs2rXw63Tq5ZH-uP1%2BoQmjLw>
