NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/45187: select(2) sometimes doesn't wakeup

>Number:         45187
>Category:       kern
>Synopsis:       select(2) sometimes doesn't wakeup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 28 16:15:01 +0000 2011
>Originator:     Manuel Bouyer
>Release:        NetBSD 5.99.55
System: NetBSD borneo 5.99.55 NetBSD 5.99.55 (GENERIC) #2: Thu Jul 28 17:49:53 
CEST 2011  
Architecture: amd64
Machine: amd64
        While testing a fix for another issue, I ran the following:
while (1)
rsync -avH --delete --delete-excluded --delete-after --delay-updates --force 
--stats --partial rsync:// .
rsync -avH --delete --delete-excluded --delete-after --delay-updates --force 
--stats --partial rsync:// .

        Then I noticed that rsync would be very slow, updating only a few
        files per minutes (the test box has a 100Mb connection to It spends most of its time in select(2),
        while the receive socket buffer is full.
        ktrace shows the following:
   4102      1 rsync    1311780519.324063908 CALL  
   4102      1 rsync    1311780579.483436279 RET   select 0
   4102      1 rsync    1311780579.483440327 CALL  
   4102      1 rsync    1311780579.483442445 RET   select 1
   4102      1 rsync    1311780579.483443326 CALL  read(3,0x7f7ff7a36de2,0x21a) 
   4102      1 rsync    1311780579.483451341 GIO   fd 3 read 538 bytes

So select blocks (maybe because there's effectively nothing to read at this
time), but instead of waking up when there's data ready it wakes up
when the timeout expires. The next select call returns immediatly.

        see above
        disabling DIRECT_SELECT in sys/kern/sys_select.c (with a
        #define NO_DIRECT_SELECT at top of file) makes rsync behaves
        as expected.

Home | Main Index | Thread Index | Old Index