Skip to contentSkip to conversation

max_clock of the patch "sched_clock: fix cpu_clock()"

DISCUSSION Lin Ming 2 participants 2 messages Sep 16, 2008

lore
Share & tools
lore

Lin Ming

author
#0 lore raw

Hi, Peter,

I have a question of the max_clock in below patch, commit 354879bb977e06695993435745f06a0f6d39ce2b

Author: Peter Zijlstra <[email protected]>
Date:   Mon Aug 25 17:15:34 2008 +0200

sched_clock: fix cpu_clock()

The original code to calculate min_clock and max_clock is, min_clock = scd->tick_gtod + delta_jiffies * TICK_NSEC; max_clock = min_clock + TICK_NSEC;

Now it's changed to,
min_clock = wrap_max(scd->tick_gtod, scd->clock); max_clock = scd->tick_gtod + TICK_NSEC;

Is this max_clock still correct if, in a rare case, irq is disabled for many ticks?

Thanks,
Lin Ming

#1 lore raw
Quoted 13 lines · Lin Ming

Hi, Peter,

I have a question of the max_clock in below patch, commit 354879bb977e06695993435745f06a0f6d39ce2b

Author: Peter Zijlstra <[email protected]>
Date:   Mon Aug 25 17:15:34 2008 +0200

sched_clock: fix cpu_clock()

The original code to calculate min_clock and max_clock is, min_clock = scd->tick_gtod + delta_jiffies * TICK_NSEC; max_clock = min_clock + TICK_NSEC;

Quoted 6 lines

Now it's changed to,
min_clock = wrap_max(scd->tick_gtod, scd->clock); max_clock = scd->tick_gtod + TICK_NSEC;

Is this max_clock still correct if, in a rare case, irq is disabled for many ticks?

Nope, it wont (nor would the old), but having irqs disabled for that long would be something worth fixing.