Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100253
b: refs/heads/master
c: f7cce27
h: refs/heads/master
i:
  100251: 62c2d3a
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Jul 11, 2008
1 parent 4c6dcca commit 0cd9080
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62c43dd9864dbd52ff158922d1d08c75f20335af
refs/heads/master: f7cce27f5605b9e137b829a47949cb2d3c7e1cab
11 changes: 9 additions & 2 deletions trunk/kernel/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,21 @@ static void __update_sched_clock(struct sched_clock_data *scd, u64 now)
s64 delta = now - scd->prev_raw;

WARN_ON_ONCE(!irqs_disabled());
min_clock = scd->tick_gtod + delta_jiffies * TICK_NSEC;

min_clock = scd->tick_gtod +
(delta_jiffies ? delta_jiffies - 1 : 0) * TICK_NSEC;

if (unlikely(delta < 0)) {
clock++;
goto out;
}

max_clock = min_clock + TICK_NSEC;
/*
* The clock must stay within a jiffie of the gtod.
* But since we may be at the start of a jiffy or the end of one
* we add another jiffy buffer.
*/
max_clock = scd->tick_gtod + (2 + delta_jiffies) * TICK_NSEC;

if (unlikely(clock + delta > max_clock)) {
if (clock < max_clock)
Expand Down

0 comments on commit 0cd9080

Please sign in to comment.