mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	stable@vger.kernel.org, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] nohz: Fix possible missing clock reprog after tick soft restart
Date: Tue, 07 Feb 2017 15:05:52 -0500	[thread overview]
Message-ID: <1486497952.2096.13.camel@redhat.com> (raw)
In-Reply-To: <1486485894-29173-1-git-send-email-fweisbec@gmail.com>

On Tue, 2017-02-07 at 17:44 +0100, Frederic Weisbecker wrote:
> ts->next_tick keeps track of the next tick deadline in order to
> optimize
> clock programmation on irq exit and avoid redundant clock device
> writes.
> 
> Now if ts->next_tick missed an update, we may spuriously miss a clock
> reprog later as the nohz code is fooled by an obsolete next_tick
> value.
> 
> This is what happens here on a specific path: when we observe an
> expired timer from the nohz update code on irq exit, we perform a
> soft
> tick restart which simply fires the closest possible tick without
> actually exiting the nohz mode and restoring a periodic state. But we
> forget to update ts->next_tick accordingly.
> 
> As a result, after the next tick resulting from such soft tick
> restart,
> the nohz code sees a stale value on ts->next_tick which doesn't match
> the clock deadline that just expired. If that obsolete ts->next_tick
> value happens to collide with the actual next tick deadline to be
> scheduled, we may spuriously bypass the clock reprogramming. In the
> worst case, the tick may never fire again.
> 
> Lets fix this with a ts->next_tick reset on soft tick restart.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Wanpeng Li <wanpeng.li@hotmail.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: stable@vger.kernel.org
> 

Acked-by: Rik van Riel <riel@redhat.com>

  reply	other threads:[~2017-02-07 20:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 16:44 Frederic Weisbecker
2017-02-07 20:05 ` Rik van Riel [this message]
2017-02-08  1:56 ` Wanpeng Li
2017-02-10  8:45 ` [tip:timers/urgent] tick/nohz: " tip-bot for Frederic Weisbecker
2017-02-17  3:22 ` [PATCH] nohz: " kbuild test robot
2017-02-17  5:34 ` kbuild test robot

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=1486497952.2096.13.camel@redhat.com \
    --to=riel@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wanpeng.li@hotmail.com \
    /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

all inboxes | Powered by JetHome®