From: Mike Galbraith <umgwanakikbuti@gmail.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: "Carsten Emde" <C.Emde@osadl.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>
Subject: Re: Latency histogram broken after "hrtimer: Set expiry time before switch_hrtimer_base()"
Date: Sun, 22 Jun 2014 06:24:09 +0200 [thread overview]
Message-ID: <1403411049.5115.28.camel@marge.simpson.net> (raw)
In-Reply-To: <1403410224.5115.26.camel@marge.simpson.net>
(CCs stable -rt maintainer)
On Sun, 2014-06-22 at 06:10 +0200, Mike Galbraith wrote:
> On Sun, 2014-06-22 at 02:04 +0100, Ben Hutchings wrote:
> > In an rt-kernel with CONFIG_MISSED_TIMER_OFFSETS_HIST enabled,
> > __hrtimer_start_range_ns() now crashes, as new_base is not assigned
> > before it is used.
>
> Oh yeah, forgot about this.
>
> > I'm not sure how this should be fixed; is it:
>
> My (3.12-ish tree) merge resolution was the later, but it shouldn't
> matter which you choose, what's stored where is unchanged pre/post.
>
> > --- a/kernel/hrtimer.c
> > +++ b/kernel/hrtimer.c
> > @@ -1108,7 +1108,7 @@ int __hrtimer_start_range_ns(struct hrti
> >
> > #ifdef CONFIG_MISSED_TIMER_OFFSETS_HIST
> > {
> > - ktime_t now = new_base->get_time();
> > + ktime_t now = base->get_time();
> >
> > if (ktime_to_ns(tim) < ktime_to_ns(now))
> > timer->praecox = now;
> > --- END ---
> >
> > or:
> >
> > --- a/kernel/hrtimer.c
> > +++ b/kernel/hrtimer.c
> > @@ -1106,6 +1106,11 @@ int __hrtimer_start_range_ns(struct hrti
> > #endif
> > }
> >
> > + hrtimer_set_expires_range_ns(timer, tim, delta_ns);
> > +
> > + /* Switch the timer base, if necessary: */
> > + new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
> > +
> > #ifdef CONFIG_MISSED_TIMER_OFFSETS_HIST
> > {
> > ktime_t now = new_base->get_time();
> > @@ -1117,11 +1122,6 @@ int __hrtimer_start_range_ns(struct hrti
> > }
> > #endif
> >
> > - hrtimer_set_expires_range_ns(timer, tim, delta_ns);
> > -
> > - /* Switch the timer base, if necessary: */
> > - new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
> > -
> > timer_stats_hrtimer_set_start_info(timer);
> >
> > leftmost = enqueue_hrtimer(timer, new_base);
> > --- END ---
> >
> > or something else?
> >
> > Ben.
> >
>
>
next prev parent reply other threads:[~2014-06-22 4:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-22 1:04 Latency histogram broken after "hrtimer: Set expiry time before switch_hrtimer_base()" Ben Hutchings
2014-06-22 4:10 ` Mike Galbraith
2014-06-22 4:24 ` Mike Galbraith [this message]
2014-06-22 9:16 ` Carsten Emde
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=1403411049.5115.28.camel@marge.simpson.net \
--to=umgwanakikbuti@gmail.com \
--cc=C.Emde@osadl.org \
--cc=ben@decadent.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=u.kleine-koenig@pengutronix.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