[PATCH 7/7] timer.c cleanups

From: Roland McGrath
Date: Mon Dec 13 2004 - 23:21:20 EST



After my recent patches, it becomes apparent that there are some useless
layers of function calls in timer.c, and a little outright dead code, that
really just confuse the situation and have no point. This patch wipes out
some cruft. (Despite the comment, run_local_timers is called by nothing.)


Signed-off-by: Roland McGrath <roland@xxxxxxxxxx>

--- linux-2.6/kernel/timer.c
+++ linux-2.6/kernel/timer.c
@@ -800,21 +800,6 @@ static void update_wall_time(unsigned lo
} while (ticks);
}

-static inline void do_process_times(struct task_struct *p,
- unsigned long user, unsigned long system)
-{
- unsigned long psecs;
-
- psecs = (p->utime += user);
- psecs += (p->stime += system);
-}
-
-static void update_one_process(struct task_struct *p, unsigned long user,
- unsigned long system, int cpu)
-{
- do_process_times(p, user, system);
-}
-
/*
* Called from the timer interrupt handler to charge one tick to the current
* process. user_tick is 1 if the tick is user time, 0 for system.
@@ -822,10 +807,13 @@ static void update_one_process(struct ta
void update_process_times(int user_tick)
{
struct task_struct *p = current;
- int cpu = smp_processor_id(), system = user_tick ^ 1;
+ int system = user_tick ^ 1;
+
+ p->utime += user_tick;
+ p->stime += system;
+
+ raise_softirq(TIMER_SOFTIRQ);

- update_one_process(p, user_tick, system, cpu);
- run_local_timers();
scheduler_tick(user_tick, system);
run_posix_cpu_timers(p);
}
@@ -892,14 +880,6 @@ static void run_timer_softirq(struct sof
}

/*
- * Called by the local, per-CPU timer interrupt on SMP.
- */
-void run_local_timers(void)
-{
- raise_softirq(TIMER_SOFTIRQ);
-}
-
-/*
* Called by the timer interrupt. xtime_lock must already be taken
* by the timer IRQ!
*/
--- linux-2.6/include/linux/timer.h
+++ linux-2.6/include/linux/timer.h
@@ -96,7 +96,6 @@ static inline void add_timer(struct time
#endif

extern void init_timers(void);
-extern void run_local_timers(void);
extern void it_real_fn(unsigned long);

#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/