diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-11 02:32:09 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-11 02:32:09 +0000 |
commit | 7f5ea64ad438953cbeb3055f424dfac01d5bcfc7 (patch) | |
tree | f8cabc30da0d0eaa578cb6369c816e02af148510 /kernel/timer.c | |
parent | 99e873a7003ab3980a6296c29066e3ab7956a009 (diff) |
Merge with Linux 2.4.0-test3.
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 1a0c2ba73..591c5e29d 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -577,7 +577,7 @@ static void update_process_times(int user_tick) p->counter = 0; p->need_resched = 1; } - if (p->priority < DEF_PRIORITY) + if (p->nice < 0) kstat.cpu_nice += user_tick; else kstat.cpu_user += user_tick; @@ -629,7 +629,8 @@ static inline void calc_load(unsigned long ticks) } } -volatile unsigned long lost_ticks; +/* jiffies at the most recent update of wall time */ +unsigned long wall_jiffies; /* * This spinlock protect us from races in SMP while playing with xtime. -arca @@ -647,14 +648,13 @@ static inline void update_times(void) */ write_lock_irq(&xtime_lock); - ticks = lost_ticks; - lost_ticks = 0; - + ticks = jiffies - wall_jiffies; if (ticks) { - calc_load(ticks); + wall_jiffies += ticks; update_wall_time(ticks); } write_unlock_irq(&xtime_lock); + calc_load(ticks); } void timer_bh(void) @@ -666,7 +666,6 @@ void timer_bh(void) void do_timer(struct pt_regs *regs) { (*(unsigned long *)&jiffies)++; - lost_ticks++; update_process_times(user_mode(regs)); mark_bh(TIMER_BH); if (tq_timer) |