From: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: Peter Zijlstra <a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org>
Cc: Michael Kerrisk
<mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
"linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: For review: timer_settime.2
Date: Sun, 15 Feb 2009 10:39:34 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.0902151036140.5958@localhost.localdomain> (raw)
In-Reply-To: <1234647684.4695.14.camel@laptop>
On Sat, 14 Feb 2009, Peter Zijlstra wrote:
> On Thu, 2009-02-12 at 08:17 +1300, Michael Kerrisk wrote:
> > Hi Peter,
> >
> > Peter Zijlstra wrote:
> > > On Tue, 2009-02-10 at 14:54 +1300, Michael Kerrisk wrote:
> > >> If the value of the CLOCK_REALTIME clock is adjusted while an
> > >> absolute timer based on that clock is armed, then the expira-
> > >> tion of the timer will be appropriately adjusted. Adjustments
> > >> to the CLOCK_REALTIME clock have no effect on relative timers
> > >> based on that clock.
> > >
> > > I cannot find this to be true.
> > >
> > >>From what I can make of the code, clock_settime() ends up calling
> > > do_sys_settimeofday() for CLOCK_REALTIME (and the other clocks).
> > >
> > > It is, however, not treating relative/abs timers any differently.
> > >
> > > Both get converted to an absolute expiration time when set.
> > >
> > > If POSIX mandates that we keep relative timers unchanged when we change
> > > the underlying clock, we'd have to iterate all pending timers and reset
> > > them.
> >
> > The rules do indeed come from POSIX.
> >
> > And indeed the rules do seem to be followed on Linux. Since I found
> > parts of the code to be hard to track, I also checked things with an
> > example program. (Ahhh! the pitfalls of reading code to find the
> > truth!)
>
> Ah, quite so. The magic is in hrtimers. Relative timers are ran on clock
> monotonic.
Yes. I tripped over the relative CLOCK_REALTIME timer not being
affected of clock modifications in the early days of hrtimers. The
solution was just to run those timers on CLOCK_MONOTONIC to avoid any
special treatment.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-02-15 9:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 1:54 For review: timer_settime.2 Michael Kerrisk
[not found] ` <4990DE50.7090503-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-12 13:54 ` Peter Zijlstra
2009-02-11 19:17 ` Michael Kerrisk
[not found] ` <49932437.3030005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-14 21:41 ` Peter Zijlstra
2009-02-15 9:39 ` Thomas Gleixner [this message]
2009-02-19 23:48 ` Michael Kerrisk
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=alpine.LFD.2.00.0902151036140.5958@localhost.localdomain \
--to=tglx-hfztesqfncyowbw4kg4ksq@public.gmane.org \
--cc=a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
/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