linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Roland Dreier <roland@purestorage.com>
Cc: John Stultz <john.stultz@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clocksource: Add heuristics to avoid switching away from TSC due to timer delay
Date: Tue, 4 Dec 2018 12:56:41 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1812041237460.8181@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20181130211750.5571-1-roland@purestorage.com>

Roland,

On Fri, 30 Nov 2018, Roland Dreier wrote:
>  		delta = clocksource_delta(csnow, cs->cs_last, cs->mask);
> +
> +		/* If the cycle delta is beyond what we can safely
> +		 * convert to nsecs, and the watchdog clocksource
> +		 * suggests that we've overslept, skip checking this
> +		 * iteration to avoid marking a clocksource as
> +		 * unstable because of a severely delayed timer. */

  		 /*
		  * Proper multiline comments look like this not like
		  * the above.
		  */

That aside. Why are you trying to do heuristics on the delta?

We have way better information than that. The watchdog timer expiry time is
known and we can determine the exact delay of the timer.

The watchdog clocksource provides the maximum 'idle' time, i.e. the time
between two reads, in clocksource::max_idle_ns. That value is filled in
when the clocksource is configured.

So without doing speculation we can make an informed decision:

    elapsed = jiffies_to_nsec(jiffies - watchdog_timer->expires) +
    	      WATCHDOG_INTERVAL_NS;

    if (elapsed > wdcs->max_idle_ns) {
       	    Skip ......
    }

Hmm?

Thanks,

	tglx

  reply	other threads:[~2018-12-04 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 21:17 [PATCH] clocksource: Add heuristics to avoid switching away from TSC due to timer delay Roland Dreier
2018-12-04 11:56 ` Thomas Gleixner [this message]
2018-12-04 19:33   ` Roland Dreier

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.DEB.2.21.1812041237460.8181@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@purestorage.com \
    --cc=sboyd@kernel.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;
as well as URLs for NNTP newsgroup(s).