Query: sk_has_sleeper
OS: suse
Section: 9
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
SK_HAS_SLEEPER(9) Linux Networking SK_HAS_SLEEPER(9)NAMEsk_has_sleeper - check if there are any waiting processesSYNOPSISint sk_has_sleeper(struct sock * sk);ARGUMENTSsk socketDESCRIPTIONReturns true if socket has waiting processes The purpose of the sk_has_sleeper and sock_poll_wait is to wrap the memory barrier call. They were added due to the race found within the tcp code.CONSIDER FOLLOWING TCP CODE PATHSCPU1 CPU2 sys_select receive packet ... ... __add_wait_queue update tp->rcv_nxt ... ... tp->rcv_nxt check sock_def_readable ... { schedule ... if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) wake_up_interruptible(sk->sk_sleep) ... } The race for tcp fires when the __add_wait_queue changes done by CPU1 stay in its cache, and so does the tp->rcv_nxt update on CPU2 side. The CPU1 could then endup calling schedule and sleep forever if there are no more data on the socket. The sk_has_sleeper is always called right after a call to read_lock, so we can use smp_mb__after_lock barrier.COPYRIGHTKernel Hackers Manual 2.6. July 2010 SK_HAS_SLEEPER(9)
Related Man Pages |
---|
del_timer_sync(9) - centos |
cset-shield(1) - debian |
svsematest(8) - debian |
__skb_recv_datagram(9) - suse |
struct_sock(9) - suse |
Similar Topics in the Unix Linux Community |
---|
Change directory error |
Migrating to UNIX |
SOCKS proxy & PAM configuration exposure |
The Future of the PM (Private Message) System at UNIX.com |
Shopt -s histappend |