lkml.org 
[lkml]   [2015]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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;
> +}


\
 
 \ /
  Last update: 2015-01-23 15:41    [W:0.152 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site