public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* HR timers prevent an itimer from generating EINTR?
@ 2009-09-04 21:26 Mike Heffner
  2009-09-24 23:09 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Heffner @ 2009-09-04 21:26 UTC (permalink / raw)
  To: linux-kernel

Summary:

Mixing HR timers with itimers occasionally hides an EINTR from a 
blocking syscall.


Description:

In my test program I have a High Resolution timer firing every one 
second (with SA_RESTART) and I set an itimer (without SA_RESTART) to 
fire after three seconds. I then execute a blocking system call (flock 
in this case) and expect the three second itimer to interrupt the system 
call with EINTR. However, I frequently notice that the itimer will fire 
but it will not interrupt the blocking system call. There appears to be 
a race between the HR timer firing and the itimer firing. If I offset 
the HR timer frequency by a half second, the itimer always interrupts 
the system call.

Kernel version:

These kernels both demonstrate the condition:

2.6.29.6-217.2.16.fc11.x86_64
	and
2.6.30.5-43.fc11.x86_64


I do not see this condition on:

2.6.18-53.el5


Test program:

The following program illustrates this condition:

http://github.com/mheffner/scripts/commits/master/hrtimer_vs_itimer.c


Is this behavior expected?


Cheers,

Mike

-- 

   Mike Heffner   <mikeh@fesnel.com>


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

end of thread, other threads:[~2009-09-25  8:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-04 21:26 HR timers prevent an itimer from generating EINTR? Mike Heffner
2009-09-24 23:09 ` Andrew Morton
2009-09-25  2:48   ` Oleg Nesterov
2009-09-25  8:15     ` Roland McGrath

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