I am not sure, but this could be related to the HZ=1024 problem Eric
Piel and I are trying to run down. This is a rather bad choice for HZ
due to round off error on the conversions to usec. We THINK the
right thing to do is to convert to nsec (this is for TICK_NSEC()),
directly rather than first to usec and then to nsec.
The additional problem is that the ntp code attempts to correct for
the roundoff error which makes for an always correcting wall clock
(even without turning on ntp). What is needed and what I am trying to
find time to do, is to convert the ntp code to work from the nsec
resolution of xtime rather from the old usec resolution. Problem is I
don't know the ntp code so it is a bit of a learning curve.
Help here is welcome!!
As a test, you might try your test with HZ=1000 (a number I recommend
for ia64, if at all possible).
-g
>
> - Richard
>
> // When run, this program should print "handled alarm" from within the
> // signal handler, and "out of sigsuspend" right after. It works on
> // 2.4.20 or if MY_TIMER_USEC is >= 2, but not on 2.5.69 with
> // MY_TIMER_USEC = 1.
>
> #define MY_TIMER_USEC 1
>
> #include <stdio.h>
> #include <unistd.h>
> #include <signal.h>
> #include <sys/time.h>
>
> void
> alarm_handler( int x )
> {
> printf( "handled alarm\n" );
> return;
> }
>
> int
> main()
> {
> struct itimerval it = { { 0, 0 }, { 0, MY_TIMER_USEC } };
> sigset_t mask;
> struct sigaction act;
>
> act.sa_handler = alarm_handler;
> act.sa_flags = 0;
> sigemptyset( &act.sa_mask );
> if( sigaction(SIGALRM, &act, 0) ) {
> perror( "sigaction" );
> exit( 1 );
> }
>
> if( setitimer(ITIMER_REAL, &it, 0) ) {
> perror( "setitimer" );
> exit( 1 );
> }
>
> sigemptyset( &mask );
> sigsuspend( &mask );
>
> printf( "out of sigsuspend\n" );
> return 0;
> }
>
-- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/