Bug 4569 - setitimer timer expires too early
Summary: setitimer timer expires too early
Status: CLOSED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Timers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: john stultz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-01 13:06 UTC by ocroquette
Modified: 2010-01-05 00:53 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.4.20, 2.6.11.7
Subsystem:
Regression: No
Bisected commit-id:


Attachments
See LKML discussion also (138 bytes, text/html)
2005-05-01 13:09 UTC, ocroquette
Details
Results for kernel 2.4 and 2.6 (8.41 KB, text/plain)
2005-05-01 13:12 UTC, ocroquette
Details
Program to test (1.77 KB, text/plain)
2005-05-01 13:12 UTC, ocroquette
Details

Description ocroquette 2005-05-01 13:06:09 UTC
Distribution: SuSE
Hardware Environment: i386 32bits
Software Environment:
Problem Description:

The setitimer man page states:

"
Timers will never expire before the requested time, instead
expiring some short, constant time afterwards, dependent on the system
timer resolution  (currently  10ms).
"
This requirement is not fulfilled for all Linux kernels that I have tested.

You will find a test program below.

There is a bunch of premature timer expirations, and there is a pattern in there:

For kernel 2.6, timers between
     "n" ms - 300 us and "n" ms expire too early
For kernel 2.4, timers between
    10*"n" ms - 600 us and 10*"n" ms expire too early

Steps to reproduce:

See program
Comment 1 ocroquette 2005-05-01 13:09:40 UTC
Created attachment 5003 [details]
See LKML discussion also

-
Comment 2 ocroquette 2005-05-01 13:12:07 UTC
Created attachment 5004 [details]
Results for kernel 2.4 and 2.6
Comment 3 ocroquette 2005-05-01 13:12:33 UTC
Created attachment 5005 [details]
Program to test
Comment 4 john stultz 2005-08-08 11:28:24 UTC
Hey George, I know you were workign on something similar recently. Is this the
same bug?
Comment 5 George Anzinger 2005-08-08 16:47:25 UTC
> ------- Additional Comments From johnstul@us.ibm.com  2005-08-08 11:28
> -------
> Hey George, I know you were workign on something similar recently. Is this
> the
> same bug?

I don't think so.  There was a recent problem with timers expiring too 
late, especially periodic where a +1 was NOT needed (we know where we 
are WRT jiffy in this case).  But I am not aware of a real problem with 
too early.

I will take a look at the test program here and let you know.

> 
Comment 6 George Anzinger 2005-08-08 17:45:03 UTC
This is fixed in 2.6.12, however, incorrectly.  There is a patch in Linus' tree
to fix it correctly.

If I had the power, I would mark as "PATCH_ALREADY_AVAILABLE" and close.
Comment 7 john stultz 2005-08-08 17:57:17 UTC
Thanks George! 

ocroquette: Could you confirm this is fixed in 2.6.13-rc6? If so I'll close this.

Note You need to log in before you can comment on or make changes to this bug.