Commit d2fe1abb authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] cleanup: move call to update_process_times.

For non-smp kernels the call to update_process_times is done in the
do_timer function.  It is more consistent with smp kernels to move this
call to the architecture file which calls do_timer.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e979196e
...@@ -138,6 +138,9 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) ...@@ -138,6 +138,9 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs)
while (nticks > 0) { while (nticks > 0) {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
nticks--; nticks--;
} }
......
...@@ -343,6 +343,9 @@ void timer_tick(struct pt_regs *regs) ...@@ -343,6 +343,9 @@ void timer_tick(struct pt_regs *regs)
do_leds(); do_leds();
do_set_rtc(); do_set_rtc();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
} }
void (*init_arch_time)(void); void (*init_arch_time)(void);
......
...@@ -166,6 +166,9 @@ EXPORT_SYMBOL(do_settimeofday); ...@@ -166,6 +166,9 @@ EXPORT_SYMBOL(do_settimeofday);
static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
do_set_rtc(); //FIME - EVERY timer IRQ? do_set_rtc(); //FIME - EVERY timer IRQ?
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
return IRQ_HANDLED; //FIXME - is this right? return IRQ_HANDLED; //FIXME - is this right?
......
...@@ -227,6 +227,9 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -227,6 +227,9 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* call the real timer interrupt handler */ /* call the real timer interrupt handler */
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
/* /*
* If we have an externally synchronized Linux clock, then update * If we have an externally synchronized Linux clock, then update
......
...@@ -46,6 +46,9 @@ static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs) ...@@ -46,6 +46,9 @@ static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
platform_timer_eoi(); platform_timer_eoi();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
} }
......
...@@ -67,14 +67,8 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) ...@@ -67,14 +67,8 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
while (1) { while (1) {
#ifdef CONFIG_SMP
/*
* For UP, this is done in do_timer(). Weird, but
* fixing that would require updates to all
* platforms.
*/
update_process_times(user_mode(regs)); update_process_times(user_mode(regs));
#endif
new_itm += local_cpu_data->itm_delta; new_itm += local_cpu_data->itm_delta;
if (smp_processor_id() == TIME_KEEPER_ID) { if (smp_processor_id() == TIME_KEEPER_ID) {
......
...@@ -45,6 +45,9 @@ static inline int set_rtc_mmss(unsigned long nowtime) ...@@ -45,6 +45,9 @@ static inline int set_rtc_mmss(unsigned long nowtime)
static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs) static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
{ {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
#ifdef CONFIG_HEARTBEAT #ifdef CONFIG_HEARTBEAT
......
...@@ -85,6 +85,9 @@ static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp) ...@@ -85,6 +85,9 @@ static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
intersil_clear(); intersil_clear();
#endif #endif
do_timer(fp); do_timer(fp);
#ifndef CONFIG_SMP
update_process_times(user_mode(fp));
#endif
if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20)) if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20))
sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160) sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160)
/20]); /20]);
......
...@@ -57,6 +57,9 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs) ...@@ -57,6 +57,9 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
write_seqlock(&xtime_lock); write_seqlock(&xtime_lock);
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
if (current->pid) if (current->pid)
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
......
...@@ -99,6 +99,9 @@ void mips_timer_interrupt(struct pt_regs *regs) ...@@ -99,6 +99,9 @@ void mips_timer_interrupt(struct pt_regs *regs)
kstat_this_cpu.irqs[irq]++; kstat_this_cpu.irqs[irq]++;
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
r4k_cur += r4k_offset; r4k_cur += r4k_offset;
ack_r4ktimer(r4k_cur); ack_r4ktimer(r4k_cur);
...@@ -137,6 +140,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -137,6 +140,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
while (time_elapsed > 0) { while (time_elapsed > 0) {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
time_elapsed -= MATCH20_INC; time_elapsed -= MATCH20_INC;
last_match20 += MATCH20_INC; last_match20 += MATCH20_INC;
jiffie_drift++; jiffie_drift++;
...@@ -153,6 +159,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -153,6 +159,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
if (jiffie_drift >= 999) { if (jiffie_drift >= 999) {
jiffie_drift -= 999; jiffie_drift -= 999;
do_timer(regs); /* increment jiffies by one */ do_timer(regs); /* increment jiffies by one */
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
} }
} }
......
...@@ -52,6 +52,9 @@ void static timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -52,6 +52,9 @@ void static timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
if (timer_intr_valid()) { if (timer_intr_valid()) {
sti(); sti();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
} }
} }
......
...@@ -73,6 +73,9 @@ void mips_timer_interrupt(struct pt_regs *regs) ...@@ -73,6 +73,9 @@ void mips_timer_interrupt(struct pt_regs *regs)
do { do {
kstat_this_cpu.irqs[irq]++; kstat_this_cpu.irqs[irq]++;
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
r4k_cur += r4k_offset; r4k_cur += r4k_offset;
ack_r4ktimer(r4k_cur); ack_r4ktimer(r4k_cur);
......
...@@ -36,6 +36,9 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -36,6 +36,9 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs)
handled = 1; handled = 1;
irq_src &= ~0x00000800; irq_src &= ~0x00000800;
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
} }
GT_WRITE(GT_INTRCAUSE_OFS, 0); GT_WRITE(GT_INTRCAUSE_OFS, 0);
......
...@@ -418,10 +418,7 @@ void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -418,10 +418,7 @@ void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
if (current->pid) if (current->pid)
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
#ifdef CONFIG_SMP
/* in UP mode, update_process_times() is invoked by do_timer() */
update_process_times(user_mode(regs)); update_process_times(user_mode(regs));
#endif
} }
/* /*
......
...@@ -134,6 +134,9 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs) ...@@ -134,6 +134,9 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs)
/* handle the timer call */ /* handle the timer call */
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
} }
if (irq_src) { if (irq_src) {
......
...@@ -112,9 +112,7 @@ void ip27_rt_timer_interrupt(struct pt_regs *regs) ...@@ -112,9 +112,7 @@ void ip27_rt_timer_interrupt(struct pt_regs *regs)
if (cpu == 0) if (cpu == 0)
do_timer(regs); do_timer(regs);
#ifdef CONFIG_SMP
update_process_times(user_mode(regs)); update_process_times(user_mode(regs));
#endif /* CONFIG_SMP */
/* /*
* If we have an externally synchronized Linux clock, then update * If we have an externally synchronized Linux clock, then update
......
...@@ -79,6 +79,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -79,6 +79,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
while (nticks--) { while (nticks--) {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
smp_do_timer(regs); smp_do_timer(regs);
#else
update_process_times(user_mode(regs));
#endif #endif
if (cpu == 0) { if (cpu == 0) {
write_seqlock(&xtime_lock); write_seqlock(&xtime_lock);
......
...@@ -150,6 +150,9 @@ void timer_interrupt(struct pt_regs * regs) ...@@ -150,6 +150,9 @@ void timer_interrupt(struct pt_regs * regs)
write_seqlock(&xtime_lock); write_seqlock(&xtime_lock);
tb_last_stamp = jiffy_stamp; tb_last_stamp = jiffy_stamp;
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
/* /*
* update the rtc when needed, this should be performed on the * update the rtc when needed, this should be performed on the
......
...@@ -277,6 +277,9 @@ int timer_interrupt(struct pt_regs * regs) ...@@ -277,6 +277,9 @@ int timer_interrupt(struct pt_regs * regs)
write_seqlock(&xtime_lock); write_seqlock(&xtime_lock);
tb_last_stamp = lpaca->next_jiffy_update_tb; tb_last_stamp = lpaca->next_jiffy_update_tb;
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
timer_sync_xtime( cur_tb ); timer_sync_xtime( cur_tb );
timer_check_rtc(); timer_check_rtc();
write_sequnlock(&xtime_lock); write_sequnlock(&xtime_lock);
......
...@@ -233,8 +233,10 @@ void account_ticks(struct pt_regs *regs) ...@@ -233,8 +233,10 @@ void account_ticks(struct pt_regs *regs)
while (ticks--) while (ticks--)
update_process_times(user_mode(regs)); update_process_times(user_mode(regs));
#else #else
while (ticks--) while (ticks--) {
do_timer(regs); do_timer(regs);
update_process_times(user_mode(regs));
}
#endif #endif
s390_do_profile(regs); s390_do_profile(regs);
} }
......
...@@ -266,6 +266,9 @@ static long last_rtc_update; ...@@ -266,6 +266,9 @@ static long last_rtc_update;
static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
#ifdef CONFIG_HEARTBEAT #ifdef CONFIG_HEARTBEAT
......
...@@ -309,6 +309,9 @@ static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *reg ...@@ -309,6 +309,9 @@ static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *reg
ctc_last_interrupt = (unsigned long) current_ctc; ctc_last_interrupt = (unsigned long) current_ctc;
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
#ifdef CONFIG_HEARTBEAT #ifdef CONFIG_HEARTBEAT
......
...@@ -716,6 +716,9 @@ static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs) ...@@ -716,6 +716,9 @@ static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs)
write_seqlock(&xtime_lock); /* Dummy, to show that we remember */ write_seqlock(&xtime_lock); /* Dummy, to show that we remember */
pcic_clear_clock_irq(); pcic_clear_clock_irq();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
write_sequnlock(&xtime_lock); write_sequnlock(&xtime_lock);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -134,6 +134,10 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -134,6 +134,10 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
clear_clock_irq(); clear_clock_irq();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
/* Determine when to update the Mostek clock. */ /* Determine when to update the Mostek clock. */
if ((time_status & STA_UNSYNC) == 0 && if ((time_status & STA_UNSYNC) == 0 &&
......
...@@ -462,6 +462,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -462,6 +462,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
do { do {
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
update_process_times(user_mode(regs));
#endif #endif
do_timer(regs); do_timer(regs);
......
...@@ -169,11 +169,9 @@ void __const_udelay(um_udelay_t usecs) ...@@ -169,11 +169,9 @@ void __const_udelay(um_udelay_t usecs)
void timer_handler(int sig, union uml_pt_regs *regs) void timer_handler(int sig, union uml_pt_regs *regs)
{ {
#ifdef CONFIG_SMP
local_irq_disable(); local_irq_disable();
update_process_times(user_context(UPT_SP(regs))); update_process_times(user_context(UPT_SP(regs)));
local_irq_enable(); local_irq_enable();
#endif
if(current_thread->cpu == 0) if(current_thread->cpu == 0)
timer_irq(regs); timer_irq(regs);
} }
......
...@@ -56,6 +56,9 @@ static irqreturn_t timer_interrupt (int irq, void *dummy, struct pt_regs *regs) ...@@ -56,6 +56,9 @@ static irqreturn_t timer_interrupt (int irq, void *dummy, struct pt_regs *regs)
mach_tick (); mach_tick ();
do_timer (regs); do_timer (regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
profile_tick(CPU_PROFILING, regs); profile_tick(CPU_PROFILING, regs);
#if 0 #if 0
/* /*
......
...@@ -427,6 +427,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -427,6 +427,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
*/ */
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
/* /*
* In the SMP case we use the local APIC timer interrupt to do the profiling, * In the SMP case we use the local APIC timer interrupt to do the profiling,
......
...@@ -30,6 +30,9 @@ p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -30,6 +30,9 @@ p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
do_leds(); do_leds();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
do_profile(regs); do_profile(regs);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -107,6 +107,9 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -107,6 +107,9 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
do_leds(); do_leds();
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
do_profile(regs); do_profile(regs);
return IRQ_HANDLED; return IRQ_HANDLED;
......
...@@ -46,6 +46,9 @@ static irqreturn_t ...@@ -46,6 +46,9 @@ static irqreturn_t
timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
do_profile(regs); do_profile(regs);
RTC_RTCC = 0; /* Clear interrupt */ RTC_RTCC = 0; /* Clear interrupt */
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
static inline void do_timer_interrupt_hook(struct pt_regs *regs) static inline void do_timer_interrupt_hook(struct pt_regs *regs)
{ {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
/* /*
* In the SMP case we use the local APIC timer interrupt to do the * In the SMP case we use the local APIC timer interrupt to do the
* profiling, except when we simulate SMP mode on a uniprocessor * profiling, except when we simulate SMP mode on a uniprocessor
......
...@@ -9,6 +9,9 @@ static inline void do_timer_interrupt_hook(struct pt_regs *regs) ...@@ -9,6 +9,9 @@ static inline void do_timer_interrupt_hook(struct pt_regs *regs)
co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR); co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR);
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
/* /*
* In the SMP case we use the local APIC timer interrupt to do the * In the SMP case we use the local APIC timer interrupt to do the
* profiling, except when we simulate SMP mode on a uniprocessor * profiling, except when we simulate SMP mode on a uniprocessor
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
static inline void do_timer_interrupt_hook(struct pt_regs *regs) static inline void do_timer_interrupt_hook(struct pt_regs *regs)
{ {
do_timer(regs); do_timer(regs);
#ifndef CONFIG_SMP
update_process_times(user_mode(regs));
#endif
voyager_timer_interrupt(regs); voyager_timer_interrupt(regs);
} }
......
...@@ -959,11 +959,6 @@ static inline void update_times(void) ...@@ -959,11 +959,6 @@ static inline void update_times(void)
void do_timer(struct pt_regs *regs) void do_timer(struct pt_regs *regs)
{ {
jiffies_64++; jiffies_64++;
#ifndef CONFIG_SMP
/* SMP process accounting uses the local APIC timer */
update_process_times(user_mode(regs));
#endif
update_times(); update_times();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment