Re: use of V_tcbinfo lock for TCP syncache

2012-12-20 Thread Vijay Singh
> How do you plan to handle the fact that most of tcp_input() and > tcp_do_segment() require at least a read lock held on the pcbinfo lock? Yes, I realized that after some experiments yesterday. > Is your goal to reduce the amount of code that gets executed under the write > lock protection of pc

Re: use of V_tcbinfo lock for TCP syncache

2012-12-20 Thread Karim Fodil-Lemelin
On 19/12/2012 6:40 PM, Vijay Singh wrote: Sure but syncache_expand() is entered with the tcbinfo already write locked which also protects the unlocking of the listening connection and the locking of the newly created socket. Around this part: /* * Socket is created in

Re: use of V_tcbinfo lock for TCP syncache

2012-12-19 Thread Vijay Singh
> Sure but syncache_expand() is entered with the tcbinfo already write locked > which also protects the unlocking of the listening connection and the > locking of the newly created socket. Around this part: > > /* > * Socket is created in state SYN_RECEIVED. >

Re: use of V_tcbinfo lock for TCP syncache

2012-12-19 Thread Karim Fodil-Lemelin
On 19/12/2012 4:01 PM, Vijay Singh wrote: 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 ker

Re: use of V_tcbinfo lock for TCP syncache

2012-12-19 Thread Vijay Singh
>> 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

Re: use of V_tcbinfo lock for TCP syncache

2012-12-19 Thread Navdeep Parhar
On 12/19/12 11:42, Navdeep Parhar wrote: > On 12/19/12 11:31, Vijay Singh wrote: >> 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

Re: use of V_tcbinfo lock for TCP syncache

2012-12-19 Thread Karim Fodil-Lemelin
On 19/12/2012 2:31 PM, Vijay Singh wrote: 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 t

Re: use of V_tcbinfo lock for TCP syncache

2012-12-19 Thread Navdeep Parhar
On 12/19/12 11:31, Vijay Singh wrote: > 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(), w