public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* select returning slow on RH 2.4.18-14 (RH 8.0) kernel.
@ 2003-02-13  9:08 Ben Greear
  2003-02-13 11:39 ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2003-02-13  9:08 UTC (permalink / raw)
  To: linux-kernel

I've been doing some testing with RH 8.0 on an Ezra 800Mhz
machine.

Even when lightly loaded select() often returns 3-9 miliseconds slower
than the timeout would suggest.  I know select is not guaranteed to
return with < 10ms accuracy, but with almost no load, shouldn't it
at least return with 1ms accuracy on average?

I don't remember having this problem on other machines and RH 7.3....

Anyone seen this problem?

Compiling a stock 2.4.20 kernel for the Ezra CPU now to see if that
helps anything...

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: select returning slow on RH 2.4.18-14 (RH 8.0) kernel.
  2003-02-13  9:08 select returning slow on RH 2.4.18-14 (RH 8.0) kernel Ben Greear
@ 2003-02-13 11:39 ` Arjan van de Ven
  2003-02-13 21:27   ` Ben Greear
  0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2003-02-13 11:39 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

On Thu, 2003-02-13 at 10:08, Ben Greear wrote:
> I've been doing some testing with RH 8.0 on an Ezra 800Mhz
> machine.
> 
> Even when lightly loaded select() often returns 3-9 miliseconds slower
> than the timeout would suggest.  I know select is not guaranteed to
> return with < 10ms accuracy, but with almost no load, shouldn't it
> at least return with 1ms accuracy on average?
no
the kernel.org kernels will return in multiple-of-10ms quantities due to
HZ having the value of 100.
2.4.18-14 (which is btw obsoleted by several security errata) has a HZ
value of 512 so will return in shorter quantities, EXCEPT when you
always try to wait exactly 10ms of course....

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: select returning slow on RH 2.4.18-14 (RH 8.0) kernel.
  2003-02-13 11:39 ` Arjan van de Ven
@ 2003-02-13 21:27   ` Ben Greear
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2003-02-13 21:27 UTC (permalink / raw)
  To: arjanv; +Cc: linux-kernel

Arjan van de Ven wrote:
> On Thu, 2003-02-13 at 10:08, Ben Greear wrote:
> 
>>I've been doing some testing with RH 8.0 on an Ezra 800Mhz
>>machine.
>>
>>Even when lightly loaded select() often returns 3-9 miliseconds slower
>>than the timeout would suggest.  I know select is not guaranteed to
>>return with < 10ms accuracy, but with almost no load, shouldn't it
>>at least return with 1ms accuracy on average?
> 
> no
> the kernel.org kernels will return in multiple-of-10ms quantities due to
> HZ having the value of 100.
> 2.4.18-14 (which is btw obsoleted by several security errata) has a HZ
> value of 512 so will return in shorter quantities, EXCEPT when you
> always try to wait exactly 10ms of course....

For posterity's sake...I think I found a somewhat suitable work around.

I set up the real-time-clock at 1024hz, open /dev/rtc, and then add it's
file descriptor to my select input set when (0 < timeout < 10).

This causes a near busy-spin on slower cpus...but for me at least that
is the lesser of two evils...

If anyone has any cleaner/better/faster/ hacks they feel like sharing,
do let me know!

PS.  Don't use SCHED_RR with this hack..or you can live-lock your system
if it's like mine :)

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-13 21:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-13  9:08 select returning slow on RH 2.4.18-14 (RH 8.0) kernel Ben Greear
2003-02-13 11:39 ` Arjan van de Ven
2003-02-13 21:27   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox