all this business about ->sk_sleep
Subsystems (2)
David Miller
maintainerSo you're probably wondering why I tidied up all of those code paths setting sk_sleep inappropriately or not using sock_graft().
If you grep the net-next-2.6 tree now there are only 6 assignments to sk->sk_sleep:
include/net/sock.h: sk->sk_sleep = NULL;include/net/sock.h: sk->sk_sleep = &parent->wait;net/core/sock.c: newsk->sk_sleep = NULL;net/core/sock.c: sk->sk_sleep = &sock->wait;net/core/sock.c: sk->sk_sleep = NULL;net/unix/af_unix.c: newsk->sk_sleep = &newu->peer_wait;
The only thing that uses something other than &sk->sk_socket->wait for sk->sk_sleep is AF_UNIX. So that's a useful discovery and we may be able to get rid of sk->sk_sleep somehow. I'll try to launch a full investiation into how and why AF_UNIX uses a special wait queue.
But the original impetus for this consolidation is that I might move struct socket freeing over to RCU in order to facilitate the removal of sk->sk_callback_lock. And if so it's tidier if there are only a handful of rcu_assign_pointer() calls to add.
Hi.
Quoted 7 lines · David Miller
net/unix/af_unix.c:newsk->sk_sleep=&newu->peer_wait;The only thing that uses something other than
&sk->sk_socket->waitforsk->sk_sleepisAF_UNIX. So that's a useful discovery and we may be able to get rid ofsk->sk_sleepsomehow. I'll try to launch a full investiation into how and whyAF_UNIXuses a special wait queue.
Its 'pipe way', which allows to wake reader when performing write on writer and vice versa.
Signature · 1 line
Evgeniy Polyakov