linux-mips
[Top] [All Lists]

Re: jiffies_64 vs. jiffies

To: nickpiggin@yahoo.com.au
Subject: Re: jiffies_64 vs. jiffies
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 02 Mar 2006 01:13:04 +0900 (JST)
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
In-reply-to: <4405B700.1080607@yahoo.com.au>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <44059915.3010800@yahoo.com.au> <20060301.235750.25910018.anemo@mba.ocn.ne.jp> <4405B700.1080607@yahoo.com.au>
Sender: linux-mips-bounce@linux-mips.org
>>>>> On Thu, 02 Mar 2006 02:00:16 +1100, Nick Piggin <nickpiggin@yahoo.com.au> 
>>>>> said:

>> Well, do you mean it should be like this ?
>> 
>> jiffies_64++;
>> update_times(jiffies_64);

nick> Yeah. It makes your patch a line smaller too!

Another solution might be simplifying update_times() like this.  It
looks there is no point to calculate ticks in update_times().

diff --git a/kernel/timer.c b/kernel/timer.c
index fe3a9a9..6188c99 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -906,14 +906,9 @@ void run_local_timers(void)
  */
 static inline void update_times(void)
 {
-       unsigned long ticks;
-
-       ticks = jiffies - wall_jiffies;
-       if (ticks) {
-               wall_jiffies += ticks;
-               update_wall_time(ticks);
-       }
-       calc_load(ticks);
+       wall_jiffies++;
+       update_wall_time(1);
+       calc_load(1);
 }
   
 /*


As for long term solution, using an union for jiffies and jiffies_64
would be robust.  But it affects so many codes ...

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>