Subject: Re: Help with xload freaking out
To: Michael L. VanLoon -- HeadCandy.com <firstname.lastname@example.org>
From: Dennis Ferguson <email@example.com>
Date: 11/15/1996 17:51:11
> Basically, after xload has been running for several days, sometimes it
> just "freaks out". It will start eating all CPU time, and will be
> constantly stuffing this into stdout:
> Warning: Select failed; error code 22
As a wild guess, have you option'd the variable TIMER_FREQ in your config
file to try to make the clock run more accurately? If so, don't do this.
If you make TIMER_FREQ larger than its default value you can cause microtime(),
and hence gettimeofday(), to very, very occasionally return a negative value of
tv.tv_usec. If you call select() with this value it'll return EINVAL. This
seems to match your symptoms, as the trace you included shows that xload
doesn't recall gettimeofday() when the error occurs it'll repeat the same
error forever once it happens.
A month or two ago I sent in a (relatively large) change to the i386
to allow it to continue to work accurately and correctly even when TIMER_FREQ
and/or HZ are reconfigured from the default, but it appears no one got around
to looking at it yet. In any case, until the current microtime() is changed
to permit changes, TIMER_FREQ needs to be treated as an unalterable constant.