cvs commit: src/sys/kern uipc_socket.c

Norikatsu Shigemura nork at FreeBSD.org
Sun Sep 5 09:44:25 PDT 2004


On Sun, 5 Sep 2004 14:33:21 +0000 (UTC)
Robert Watson <rwatson at freebsd.org> 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 <mcsi at mcsi dot pp dot ru>
>   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


More information about the cvs-src mailing list