public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Heffner <mikeh@fesnel.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	john stultz <johnstul@us.ibm.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: HR timers prevent an itimer from generating EINTR?
Date: Thu, 24 Sep 2009 16:09:46 -0700	[thread overview]
Message-ID: <20090924160946.f54aa215.akpm@linux-foundation.org> (raw)
In-Reply-To: <4AA1860B.4030409@fesnel.com>

(cc's added)

(it's a regression)

(it has a testcase!)

On Fri, 04 Sep 2009 17:26:35 -0400
Mike Heffner <mikeh@fesnel.com> wrote:

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


  reply	other threads:[~2009-09-24 23:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 21:26 HR timers prevent an itimer from generating EINTR? Mike Heffner
2009-09-24 23:09 ` Andrew Morton [this message]
2009-09-25  2:48   ` Oleg Nesterov
2009-09-25  8:15     ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090924160946.f54aa215.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikeh@fesnel.com \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox