On Thu, 13 Apr 2006, Ram Gupta wrote:
> I am using select with a timeout value of 90 ms. But for some reason
> occasionally it comes out of select after more than one second . I
> checked the man page but it does not help in concluding if this is ok
> or not. Is this expected or it is a bug. Most of this time is
> consumed in schedule_timeout . I am using 2.5.45 kernel but I
> believe the same would be the true for the latest kernel too. Any
> thoughts or suggestion are welcome.
>
> Thanks
> Ram Gupta
This may point out a problem with a driver that is polling
inside a spin-lock or other places where interrupts are disabled.
It is unlikely that select() or poll() are at fault. I have a
server that takes high-speed DAS data and sends it over the
network as UDP packets. The server sleeps in poll() until data
are ready, then wakes up and sends the data. This happens 4,000
times per second and has been tested to 10,000 times per second.
The HZ value on that server is 1024. So, poll() and select()
can be fast in response to a 'wake_up_interruptible()' inside
a driver. They should be equally fast to a normal timeout.
Make sure that your 'struct timeval' is initialized prior to every
call to select(). Linux writes remaining time back into that
structure! Also make sure you are using the right structure,
'struct timeval', not 'struct timespec'!
Cheers,
Dick Johnson
Penguin : Linux version 2.6.15.4 on an i686 machine (5589.54 BogoMips).
Warning : 98.36% of all statistics are fiction, book release in April.
_
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.
Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]