All of lore.kernel.org
 help / color / mirror / Atom feed
* Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17
  2004-10-07  4:56                     ` Posix compliant cpu clocks V7 [0/2]: Rationale and test program Christoph Lameter
@ 2004-10-12 20:19                       ` Christoph Lameter
  2004-10-12 22:24                         ` George Anzinger
  2004-10-13 18:08                         ` Alexander Nyberg
  0 siblings, 2 replies; 7+ messages in thread
From: Christoph Lameter @ 2004-10-12 20:19 UTC (permalink / raw)
  To: George Anzinger; +Cc: johnstul, Ulrich.Windl, jbarnes, linux-kernel, roland

I ran some test programs and discovered that the periodic timer support
is broken. The timer is triggered once and then never again. Single shot
timers work fine. 2.6.9-rc1 is fine. The first kernel that I tested where
I noticed the breakage was 2.6.9-rc1-bk17. 2.6.9-rc2 and following all
cannot do periodic timer signals.

I looked through the changelog but I cannot see anything that would cause
the problem. Roland's patch surely could not have done this.

Will try to track this down further, time permitting...

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

* Re: Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17
  2004-10-12 20:19                       ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 Christoph Lameter
@ 2004-10-12 22:24                         ` George Anzinger
  2004-10-13 18:08                         ` Alexander Nyberg
  1 sibling, 0 replies; 7+ messages in thread
From: George Anzinger @ 2004-10-12 22:24 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: johnstul, Ulrich.Windl, jbarnes, linux-kernel, roland

Christoph Lameter wrote:
> I ran some test programs and discovered that the periodic timer support
> is broken. The timer is triggered once and then never again. Single shot
> timers work fine. 2.6.9-rc1 is fine. The first kernel that I tested where
> I noticed the breakage was 2.6.9-rc1-bk17. 2.6.9-rc2 and following all
> cannot do periodic timer signals.
> 
> I looked through the changelog but I cannot see anything that would cause
> the problem. Roland's patch surely could not have done this.
> 
> Will try to track this down further, time permitting...

The most likely thing would be failure to do the call back from the signal 
delivery code.
-- 
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


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

* Re: Periodic posix timer support broke between 2.6.9-rc1 and
@ 2004-10-13 16:03 Christoph Lameter
  2004-10-13 17:25 ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 George Anzinger
  2004-10-13 17:29 ` Periodic posix timer support broke between 2.6.9-rc1 and Christoph Lameter
  0 siblings, 2 replies; 7+ messages in thread
From: Christoph Lameter @ 2004-10-13 16:03 UTC (permalink / raw)
  To: linux-ia64

On Tue, 12 Oct 2004, George Anzinger wrote:

> Christoph Lameter wrote:
> > I ran some test programs and discovered that the periodic timer support
> > is broken. The timer is triggered once and then never again. Single shot
> > timers work fine. 2.6.9-rc1 is fine. The first kernel that I tested where
> > I noticed the breakage was 2.6.9-rc1-bk17. 2.6.9-rc2 and following all
> > cannot do periodic timer signals.
> >
> > I looked through the changelog but I cannot see anything that would cause
> > the problem. Roland's patch surely could not have done this.
> >
> > Will try to track this down further, time permitting...
>
> The most likely thing would be failure to do the call back from the signal
> delivery code.

The problem is IA64 arch specific. Works fine on i386.


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

* Re: Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17
  2004-10-13 16:03 Periodic posix timer support broke between 2.6.9-rc1 and Christoph Lameter
@ 2004-10-13 17:25 ` George Anzinger
  2004-10-13 17:29 ` Periodic posix timer support broke between 2.6.9-rc1 and Christoph Lameter
  1 sibling, 0 replies; 7+ messages in thread
From: George Anzinger @ 2004-10-13 17:25 UTC (permalink / raw)
  To: linux-ia64

Christoph Lameter wrote:
> On Tue, 12 Oct 2004, George Anzinger wrote:
> 
> 
>>Christoph Lameter wrote:
>>
>>>I ran some test programs and discovered that the periodic timer support
>>>is broken. The timer is triggered once and then never again. Single shot
>>>timers work fine. 2.6.9-rc1 is fine. The first kernel that I tested where
>>>I noticed the breakage was 2.6.9-rc1-bk17. 2.6.9-rc2 and following all
>>>cannot do periodic timer signals.
>>>
>>>I looked through the changelog but I cannot see anything that would cause
>>>the problem. Roland's patch surely could not have done this.
>>>
>>>Will try to track this down further, time permitting...
>>
>>The most likely thing would be failure to do the call back from the signal
>>delivery code.
> 
> 
> The problem is IA64 arch specific. Works fine on i386.

And I repeat:
The most likely thing would be failure to do the call back from the signal
delivery code.

> 

-- 
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


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

* Re: Periodic posix timer support broke between 2.6.9-rc1 and
  2004-10-13 16:03 Periodic posix timer support broke between 2.6.9-rc1 and Christoph Lameter
  2004-10-13 17:25 ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 George Anzinger
@ 2004-10-13 17:29 ` Christoph Lameter
  1 sibling, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2004-10-13 17:29 UTC (permalink / raw)
  To: linux-ia64

On Wed, 13 Oct 2004, George Anzinger wrote:

> The most likely thing would be failure to do the call back from the signal
> delivery code.

The problem was my setting of the resolution of CLOCK_REALTIME and
CLOCK_MONOTONIC to the resolution of the time interpolator. That screwed
up interval calculation. Fix was submitted to Andrew and Linus and will
hopefully get into 2.6.9 final.



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

* Re: Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17
  2004-10-12 20:19                       ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 Christoph Lameter
  2004-10-12 22:24                         ` George Anzinger
@ 2004-10-13 18:08                         ` Alexander Nyberg
  2004-10-13 18:11                           ` Christoph Lameter
  1 sibling, 1 reply; 7+ messages in thread
From: Alexander Nyberg @ 2004-10-13 18:08 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: George Anzinger, johnstul, Ulrich.Windl, jbarnes, linux-kernel,
	roland, Ingo Molnar

> I ran some test programs and discovered that the periodic timer support
> is broken. The timer is triggered once and then never again. Single shot
> timers work fine. 2.6.9-rc1 is fine. The first kernel that I tested where
> I noticed the breakage was 2.6.9-rc1-bk17. 2.6.9-rc2 and following all
> cannot do periodic timer signals.
> 
> I looked through the changelog but I cannot see anything that would cause
> the problem. Roland's patch surely could not have done this.
> 
> Will try to track this down further, time permitting...

I took a bit of a look at this, and it looks like some things changed
with the introduction of the flexible mmap in 2.6.9-rc1-bk1.

If you run the program below it will work, doing as expected. Now
comment out the the line "memset(&sa, 0, sizeof(struct sigaction));"
and program won't run as expected.

Now do "echo -n 1 > /proc/sys/vm/legacy_va_layout" and run the same
program again (the one with memset commented out).

Turning on signal debugging tells us that with legacy_va_layout=0
"SIG deliver (a.out:415): sp=bffff6c0 pc=08048434 ra=00000000"
where ra is the 8-byte instruction that's supposed to get us back to
sys_sigreturn().

Me thinks someone somewhere is using some of the bits that we
"accidently" pass via sa.sa_flags by not setting it to 0, the regular
flags don't seem to show this behaviour, and I couldn't see any real
checking of the passed value of sa.sa_flags.

---------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>

void sighandler(int signal)
{
	printf("hihi\n");
}

int main()
{
	struct itimerval timeval;
	struct sigaction sa;
	
	memset(&timeval, 0, sizeof(struct timeval));
	memset(&sa, 0, sizeof(struct sigaction));
	
	sa.sa_handler = &sighandler;
	sigfillset(&sa.sa_mask);
	
	sigaction(SIGALRM, &sa, NULL);
	
	timeval.it_interval.tv_sec = 2;
	timeval.it_interval.tv_usec = 0;
	
	timeval.it_value.tv_sec = 2;
	timeval.it_value.tv_usec = 0;
	
	if (setitimer(ITIMER_REAL, &timeval, NULL))
		printf("Nooo!\n");

	for(;;)
		;

	return 0;
}


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

* Re: Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17
  2004-10-13 18:08                         ` Alexander Nyberg
@ 2004-10-13 18:11                           ` Christoph Lameter
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Lameter @ 2004-10-13 18:11 UTC (permalink / raw)
  To: Alexander Nyberg
  Cc: George Anzinger, johnstul, Ulrich.Windl, jbarnes, linux-kernel,
	roland, Ingo Molnar

> Me thinks someone somewhere is using some of the bits that we
> "accidently" pass via sa.sa_flags by not setting it to 0, the regular
> flags don't seem to show this behaviour, and I couldn't see any real
> checking of the passed value of sa.sa_flags.

Nope. It was my screwed up setting of the resolution of CLOCK_REALTIME and
CLOCK_MONOTONIC. Fix was submitted to Linus and Andrew.


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

end of thread, other threads:[~2004-10-13 18:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13 16:03 Periodic posix timer support broke between 2.6.9-rc1 and Christoph Lameter
2004-10-13 17:25 ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 George Anzinger
2004-10-13 17:29 ` Periodic posix timer support broke between 2.6.9-rc1 and Christoph Lameter
     [not found] <B6E8046E1E28D34EB815A11AC8CA312902CD3264@mtv-atc-605e--n.corp.sgi.com>
2004-09-24 12:16 ` [time] add support for CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID Christoph Lameter
2004-09-25  4:25   ` Ulrich Drepper
2004-09-25  5:54     ` Christoph Lameter
2004-09-25  6:08       ` Ulrich Drepper
     [not found]         ` <B6E8046E1E28D34EB815A11AC8CA312902CD327E@mtv-atc-605e--n.corp.sgi.com>
2004-09-27 20:58           ` [RFC] Posix compliant behavior of CLOCK_PROCESS/THREAD_CPUTIME_ID Christoph Lameter
2004-09-28 19:18             ` Ulrich Drepper
2004-09-29  3:25               ` Posix compliant CLOCK_PROCESS/THREAD_CPUTIME_ID V4 Christoph Lameter
2004-09-29 17:45                 ` George Anzinger
     [not found]                   ` <B6E8046E1E28D34EB815A11AC8CA31290322B307@mtv-atc-605e--n.corp.sgi.com>
2004-10-07  4:56                     ` Posix compliant cpu clocks V7 [0/2]: Rationale and test program Christoph Lameter
2004-10-12 20:19                       ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 Christoph Lameter
2004-10-12 22:24                         ` George Anzinger
2004-10-13 18:08                         ` Alexander Nyberg
2004-10-13 18:11                           ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.