[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150123142825.GB23123@twins.programming.kicks-ass.net>
Date: Fri, 23 Jan 2015 15:28:25 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: John Stultz <john.stultz@...aro.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Dave Jones <davej@...emonkey.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Cochran <richardcochran@...il.com>,
Prarit Bhargava <prarit@...hat.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 06/12] time: Add infrastructure to cap clocksource reads
to the max_cycles value
On Thu, Jan 22, 2015 at 04:09:21PM -0800, John Stultz wrote:
> +static inline cycle_t timekeeping_get_delta(struct tk_read_base *tkr)
> +{
> + cycle_t cycle_now, delta;
> +
> + /* read clocksource */
> + cycle_now = tkr->read(tkr->clock);
> +
> + /* calculate the delta since the last update_wall_time */
> + delta = clocksource_delta(cycle_now, tkr->cycle_last, tkr->mask);
> +
> + /* Cap delta value to the max_cycles values to avoid mult overflows */
> + if (unlikely(delta > tkr->clock->max_cycles))
> + delta = tkr->clock->max_cycles;
Should we not raise _something_ here? I know we cannot printk() here,
but bad (TM) things happened if this ever triggers.
> +
> + return delta;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists