From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Rik van Riel <riel@redhat.com>,
James Hartsock <hartsjc@redhat.com>,
Tim Wright <tim@binbash.co.uk>, Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH 0/2] nohz: Deal with clock reprogram skipping issues v2
Date: Wed, 26 Apr 2017 16:55:15 +0200 [thread overview]
Message-ID: <20170426145514.GB16523@lerouge> (raw)
In-Reply-To: <20170424144523.smldipadtlukkpoc@gmail.com>
On Mon, Apr 24, 2017 at 04:45:23PM +0200, Ingo Molnar wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > On Mon, Apr 24, 2017 at 10:08:35AM +0200, Ingo Molnar wrote:
> > >
> > > * Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > >
> > > > As suggested by Thomas Gleixner, the second patch now integrates
> > > > a fix in case the sanity check fails and the clockevent isn't programmed
> > > > as expected.
> > > >
> > > > Frederic Weisbecker (2):
> > > > nohz: Fix again collision between tick and other hrtimers
> > > > tick: Make sure tick timer is active when bypassing reprogramming
> > > >
> > > > kernel/time/tick-sched.c | 33 ++++++++++++++++++++++++++++++---
> > > > kernel/time/tick-sched.h | 2 ++
> > > > 2 files changed, 32 insertions(+), 3 deletions(-)
> > >
> > > So I think one of these is causing a new warning on latest -tip:
> > >
> > > [ 333.341756] ------------[ cut here ]------------
> > > [ 333.346404] WARNING: CPU: 0 PID: 0 at kernel/time/tick-sched.c:874 __tick_nohz_idle_enter+0x461/0x490
> >
> > Oh I'll never be done with that bug :)
> >
> > Ok I just booted your config with tip/master and didn't see the warning.
> > But the boot seem to be stalled some time after mounting the root fs.
> >
> > Can you please try the following patch and tell me what it returns to you?
> >
> > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> > index c47d135..6d72e8b 100644
> > --- a/kernel/time/tick-sched.c
> > +++ b/kernel/time/tick-sched.c
> > @@ -872,6 +872,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
> > goto out;
> >
> > WARN_ON_ONCE(1);
> > + printk_once("basemono: %llu ts->next_tick: %llu dev->next_event: %llu\n", basemono, ts->next_tick, dev->next_event);
> > }
> >
>
> Here's what it prints:
>
> [ 707.251791] basemono: 706016000000 ts->next_tick: 693216000000 dev->next_event: 706016406127
So weird...
Ok I'm going to need serious traces. Can you please add this boot option?
trace_event=hrtimer_cancel,hrtimer_start,hrtimer_expire_entry
And please also apply the following (on top of tip/tmp.tmp), it would be interesting to see
the resulting trace file from the CPU where the warning triggers.
Thanks Ingo!
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index b2df684..b4a6dda 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -156,6 +156,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
* to the same deadline.
*/
ts->next_tick = 0;
+ trace_printk("ts->next_tick reset (tick)\n");
}
#endif
update_process_times(user_mode(regs));
@@ -672,6 +673,7 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
* cached clock deadline.
*/
ts->next_tick = 0;
+ trace_printk("ts->next_tick reset (tick restart)\n");
}
static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
@@ -789,6 +791,8 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
goto out;
WARN_ON_ONCE(1);
+ trace_printk("basemono: %llu ts->next_tick: %llu dev->next_event: %llu\n", basemono, ts->next_tick, dev->next_event);
+ tracing_stop();
printk_once("basemono: %llu ts->next_tick: %llu dev->next_event: %llu\n", basemono, ts->next_tick, dev->next_event);
}
@@ -810,6 +814,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
}
ts->next_tick = tick;
+ trace_printk("ts->next_tick = %llu\n", ts->next_tick);
/*
* If the expiration time == KTIME_MAX, then we simply stop
@@ -892,6 +897,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
* deadline if it comes back online later.
*/
ts->next_tick = 0;
+ trace_printk("ts->next_tick reset (offline)\n");
return false;
}
next prev parent reply other threads:[~2017-04-26 14:55 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 14:00 [PATCH 0/2] nohz: Deal with clock reprogram skipping issues v2 Frederic Weisbecker
2017-04-21 14:00 ` [PATCH 1/2] nohz: Fix again collision between tick and other hrtimers Frederic Weisbecker
2017-04-23 11:36 ` [tip:timers/urgent] " tip-bot for Frederic Weisbecker
2017-05-17 8:46 ` [tip:timers/nohz] nohz: Fix collision between tick and other hrtimers, again tip-bot for Frederic Weisbecker
2017-04-21 14:00 ` [PATCH 2/2] tick: Make sure tick timer is active when bypassing reprogramming Frederic Weisbecker
2017-04-23 11:37 ` [tip:timers/urgent] " tip-bot for Frederic Weisbecker
2017-06-03 8:06 ` [PATCH 2/2] " Levin, Alexander (Sasha Levin)
2017-06-03 12:42 ` Frederic Weisbecker
2017-06-03 13:00 ` Levin, Alexander (Sasha Levin)
2017-06-06 14:52 ` Frederic Weisbecker
2017-06-07 4:17 ` Levin, Alexander (Sasha Levin)
2017-06-07 14:14 ` Frederic Weisbecker
2017-06-07 21:36 ` Levin, Alexander (Sasha Levin)
2017-06-08 19:07 ` [PATCH] nohz: Fix spurious warning when hrtimer and clockevent get out of sync Frederic Weisbecker
2017-06-08 22:13 ` Levin, Alexander (Sasha Levin)
2017-06-09 0:48 ` Frederic Weisbecker
2017-06-09 12:13 ` Levin, Alexander (Sasha Levin)
2017-06-09 12:26 ` Peter Zijlstra
2017-06-09 13:06 ` Frederic Weisbecker
2017-04-24 8:08 ` [PATCH 0/2] nohz: Deal with clock reprogram skipping issues v2 Ingo Molnar
2017-04-24 14:04 ` Frederic Weisbecker
2017-04-24 14:45 ` Ingo Molnar
2017-04-26 14:55 ` Frederic Weisbecker [this message]
2017-04-26 18:49 ` Ingo Molnar
2017-04-26 21:07 ` Frederic Weisbecker
2017-04-24 17:01 ` [tip:timers/urgent] nohz: Print more debug info in tick_nohz_stop_sched_tick() tip-bot for Frederic Weisbecker
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=20170426145514.GB16523@lerouge \
--to=fweisbec@gmail.com \
--cc=hartsjc@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pavel@ucw.cz \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=tglx@linutronix.de \
--cc=tim@binbash.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).