[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1812041237460.8181@nanos.tec.linutronix.de>
Date: Tue, 4 Dec 2018 12:56:41 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Roland Dreier <roland@...estorage.com>
cc: John Stultz <john.stultz@...aro.org>,
Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clocksource: Add heuristics to avoid switching away from
TSC due to timer delay
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
Powered by blists - more mailing lists