From owner-cvs-all@FreeBSD.ORG Sun Sep 5 16:44:25 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAB0316A4CE; Sun, 5 Sep 2004 16:44:25 +0000 (GMT) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13FE743D4C; Sun, 5 Sep 2004 16:44:25 +0000 (GMT) (envelope-from nork@FreeBSD.org) Received: from pelsia.ninth-nine.com (pelsia.ninth-nine.com [219.127.74.123]) (authenticated bits=0) by sakura.ninth-nine.com (8.12.11/8.12.11/NinthNine) with ESMTP id i85GiL2Y043104; Mon, 6 Sep 2004 01:44:21 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Mon, 6 Sep 2004 01:44:21 +0900 (JST) Message-Id: <200409051644.i85GiL2Y043104@sakura.ninth-nine.com> From: Norikatsu Shigemura To: Robert Watson In-Reply-To: <200409051433.i85EXLd2029734@repoman.freebsd.org> References: <200409051433.i85EXLd2029734@repoman.freebsd.org> X-Mailer: Sylpheed version 0.9.12-gtk2-20040622 (GTK+ 2.4.4; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.5.6 (sakura.ninth-nine.com [219.127.74.121]); Mon, 06 Sep 2004 01:44:21 +0900 (JST) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2004 16:44:25 -0000 On Sun, 5 Sep 2004 14:33:21 +0000 (UTC) Robert Watson wrote: > rwatson 2004-09-05 14:33:21 UTC > FreeBSD src repository > Modified files: > sys/kern uipc_socket.c > Log: > Expand the scope of the socket buffer locks in sopoll() to include the > state test as well as set, or we risk a race between a socket wakeup > and registering for select() or poll() on the socket. This does > increase the cost of the poll operation, but can probably be optimized > some in the future. > This appears to correct poll() "wedges" experienced with X11 on SMP > systems with highly interactive applications, and might affect a plethora > of other select() driven applications. > RELENG_5 candidate. > Problem reported by: Maxim Maximov > Debugged with help of: dwhite Hum... I ran xmms(start play) and ASAP panic. [thread 100112] Stopped at sched_choose+0x54: cmpb $0x4,0x4c(%eax) db> where sched_choose(ec125aac,c055c547,c3052680,0,ec125ad0) at sched_choose+0x54 choosethread(c2fe2d90,c30527d4,c3051700,ec125ad0,628faa00) at choosethread+0x45 sched_switch(c3052680,0,0,7c68ea02,73fe2e48) at sched_switch+0x145 mi_switch(1,0,ec125b5c,c056eed0,c32be500) at mi_switch+0x1c2 sleepq_switch(c07f2844,1,ec125b90,c0517c47,c07f2844) at sleepq_switch+0x177 sleepq_wait_sig(c07f2844,c07f2844,c07f2820,c074ec89,101) at sleepq_wait_sig+0x12 cv_wait_sig(c07f2844,c07f2820,1,0,0) at cv_wait_sig+0x227 poll(c3052680,ec125d14,c,16,c3052680) at poll+0x645 syscall(2f,2f,2f,813b000,3) at syscall+0x330 Xint0x80_syscall() at Xint0x80_syscall+0x1f --- syscall (209, FreeBSD ELF32, poll), eip = 0x684e5a1f, esp = 0xbfbfe8cc, ebp = 0xbfbfe8e8 --- db> show pcpu cpuid = 1 curthread = 0xc3052680: pid 651 "xmms" curpcb = 0xec125da0 fpcurthread = 0xc3052680: pid 651 "xmms" idlethread = 0xc2b88340: pid 11 "idle: cpu1" APIC ID = 1 currentldt = 0x30 db> show pcpu 0 cpuid = 0 curthread = 0xc3054680: pid 604 "Xorg" curpcb = 0xec140da0 fpcurthread = none idlethread = 0xc2b884e0: pid 12 "idle: cpu0" APIC ID = 0 currentldt = 0x30 db> show pcpu 1 cpuid = 1 curthread = 0xc3052680: pid 651 "xmms" curpcb = 0xec125da0 fpcurthread = 0xc3052680: pid 651 "xmms" idlethread = 0xc2b88340: pid 11 "idle: cpu1" APIC ID = 1 currentldt = 0x30 db> tr 651 fork_trampoline() at fork_trampoline db> tr 604 sched_switch(c3054680,c2e26200,40,ec140ab8,c0582d0b) at sched_switch+0x160 mi_switch(ec140b10,c0783320,12,1,ec140b10) at mi_switch+0x1c2 _end(57e58955,ec835356,8458b34,8910408b,558be045) at 0xec140af0 db> tr 11 sched_switch(c2b88340,0,c0479945,89628f48,39a1a3bc) at sched_switch+0x160 mi_switch(1,0,0,0,0) at mi_switch+0x1c2 idle_proc(0,e4094d48,0,0,0) at idle_proc+0x14d fork_exit(c052ba60,0,e4094d48) at fork_exit+0x80 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xe4094d7c, ebp = 0 --- db> tr 12 sched_switch(c2b884e0,0,1,20f8164c,cb694953) at sched_switch+0x160 mi_switch(1,0,0,0,0) at mi_switch+0x1c2 idle_proc(0,e4097d48,0,0,0) at idle_proc+0x14d fork_exit(c052ba60,0,e4097d48) at fork_exit+0x80 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xe4097d7c, ebp = 0 --- debug.mpsafenet=1 debug.mpsafevm=1 net.isr.enable=1 no PREEMPTION SCHED_ULE > Revision Changes Path > 1.212 +4 -4 src/sys/kern/uipc_socket.c