From d2fe1abb63c0fc5c31023b16b7c0f2ce316525de Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Mon, 18 Oct 2004 18:13:23 -0700 Subject: [PATCH] [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: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/alpha/kernel/time.c | 3 +++ arch/arm/kernel/time.c | 3 +++ arch/arm26/kernel/time.c | 3 +++ arch/cris/arch-v10/kernel/time.c | 3 +++ arch/h8300/kernel/time.c | 3 +++ arch/ia64/kernel/time.c | 8 +------- arch/m68k/kernel/time.c | 3 +++ arch/m68k/sun3/sun3ints.c | 3 +++ arch/m68knommu/kernel/time.c | 3 +++ arch/mips/au1000/common/time.c | 9 +++++++++ arch/mips/baget/time.c | 3 +++ arch/mips/galileo-boards/ev96100/time.c | 3 +++ arch/mips/gt64120/common/time.c | 3 +++ arch/mips/kernel/time.c | 3 --- arch/mips/momentum/ocelot_g/gt-irq.c | 3 +++ arch/mips/sgi-ip27/ip27-timer.c | 2 -- arch/parisc/kernel/time.c | 2 ++ arch/ppc/kernel/time.c | 3 +++ arch/ppc64/kernel/time.c | 3 +++ arch/s390/kernel/time.c | 4 +++- arch/sh/kernel/time.c | 3 +++ arch/sh64/kernel/time.c | 3 +++ arch/sparc/kernel/pcic.c | 3 +++ arch/sparc/kernel/time.c | 4 ++++ arch/sparc64/kernel/time.c | 1 + arch/um/kernel/time_kern.c | 2 -- arch/v850/kernel/time.c | 3 +++ arch/x86_64/kernel/time.c | 3 +++ include/asm-arm/arch-clps711x/time.h | 3 +++ include/asm-arm/arch-integrator/time.h | 3 +++ include/asm-arm/arch-l7200/time.h | 3 +++ include/asm-i386/mach-default/do_timer.h | 3 +++ include/asm-i386/mach-visws/do_timer.h | 3 +++ include/asm-i386/mach-voyager/do_timer.h | 3 +++ kernel/timer.c | 5 ----- 35 files changed, 95 insertions(+), 20 deletions(-) diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 5ff439b04baec..e74677115e2b1 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -138,6 +138,9 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs) while (nticks > 0) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif nticks--; } diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 3043e6de75d99..2e16689ec4c6d 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -343,6 +343,9 @@ void timer_tick(struct pt_regs *regs) do_leds(); do_set_rtc(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } void (*init_arch_time)(void); diff --git a/arch/arm26/kernel/time.c b/arch/arm26/kernel/time.c index dbbc21404727e..a7a18c4b21acc 100644 --- a/arch/arm26/kernel/time.c +++ b/arch/arm26/kernel/time.c @@ -166,6 +166,9 @@ EXPORT_SYMBOL(do_settimeofday); static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif do_set_rtc(); //FIME - EVERY timer IRQ? profile_tick(CPU_PROFILING, regs); return IRQ_HANDLED; //FIXME - is this right? diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index 298e86a01c01f..89e4efb9984ab 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c @@ -227,6 +227,9 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* call the real timer interrupt handler */ do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif /* * If we have an externally synchronized Linux clock, then update diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c index 0b293d652bf46..8a600218334df 100644 --- a/arch/h8300/kernel/time.c +++ b/arch/h8300/kernel/time.c @@ -46,6 +46,9 @@ static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs) platform_timer_eoi(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); } diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 853d8dae7c3d7..992854fa4b4c3 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -67,14 +67,8 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) profile_tick(CPU_PROFILING, regs); 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)); -#endif + new_itm += local_cpu_data->itm_delta; if (smp_processor_id() == TIME_KEEPER_ID) { diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 11d122980d3bd..e47e19588525e 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c @@ -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) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index bca65bd06b612..3cf200dc7e7d1 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -85,6 +85,9 @@ static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp) intersil_clear(); #endif do_timer(fp); +#ifndef CONFIG_SMP + update_process_times(user_mode(fp)); +#endif if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20)) sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160) /20]); diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index e328f2810b17a..5c3ca671627c1 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c @@ -57,6 +57,9 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs) write_seqlock(&xtime_lock); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif if (current->pid) profile_tick(CPU_PROFILING, regs); diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index a72de97275f06..d9f4c1bb6ecb5 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -99,6 +99,9 @@ void mips_timer_interrupt(struct pt_regs *regs) kstat_this_cpu.irqs[irq]++; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif r4k_cur += r4k_offset; ack_r4ktimer(r4k_cur); @@ -137,6 +140,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) while (time_elapsed > 0) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif time_elapsed -= MATCH20_INC; last_match20 += MATCH20_INC; jiffie_drift++; @@ -153,6 +159,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) if (jiffie_drift >= 999) { jiffie_drift -= 999; do_timer(regs); /* increment jiffies by one */ +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } } diff --git a/arch/mips/baget/time.c b/arch/mips/baget/time.c index ed82c62df3d62..e715cb6bc0fb0 100644 --- a/arch/mips/baget/time.c +++ b/arch/mips/baget/time.c @@ -52,6 +52,9 @@ void static timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) if (timer_intr_valid()) { sti(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } } diff --git a/arch/mips/galileo-boards/ev96100/time.c b/arch/mips/galileo-boards/ev96100/time.c index 10189b95d56b3..8cbe8426491a4 100644 --- a/arch/mips/galileo-boards/ev96100/time.c +++ b/arch/mips/galileo-boards/ev96100/time.c @@ -73,6 +73,9 @@ void mips_timer_interrupt(struct pt_regs *regs) do { kstat_this_cpu.irqs[irq]++; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif r4k_cur += r4k_offset; ack_r4ktimer(r4k_cur); diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c index 44f33caf298ec..edcea9fbeda58 100644 --- a/arch/mips/gt64120/common/time.c +++ b/arch/mips/gt64120/common/time.c @@ -36,6 +36,9 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs) handled = 1; irq_src &= ~0x00000800; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } GT_WRITE(GT_INTRCAUSE_OFS, 0); diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 915e5539e7f26..0a4bf6b3256d7 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -418,10 +418,7 @@ void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { if (current->pid) 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)); -#endif } /* diff --git a/arch/mips/momentum/ocelot_g/gt-irq.c b/arch/mips/momentum/ocelot_g/gt-irq.c index 93708965be11e..cede65a406327 100644 --- a/arch/mips/momentum/ocelot_g/gt-irq.c +++ b/arch/mips/momentum/ocelot_g/gt-irq.c @@ -134,6 +134,9 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs) /* handle the timer call */ do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } if (irq_src) { diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index cc0419ad7407e..9d384d13132d5 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c @@ -112,9 +112,7 @@ again: if (cpu == 0) do_timer(regs); -#ifdef CONFIG_SMP update_process_times(user_mode(regs)); -#endif /* CONFIG_SMP */ /* * If we have an externally synchronized Linux clock, then update diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 8f4ad0cf228de..6cf7407344bad 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -79,6 +79,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) while (nticks--) { #ifdef CONFIG_SMP smp_do_timer(regs); +#else + update_process_times(user_mode(regs)); #endif if (cpu == 0) { write_seqlock(&xtime_lock); diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 60e7ef5ad9abc..8839f6f07dabc 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -150,6 +150,9 @@ void timer_interrupt(struct pt_regs * regs) write_seqlock(&xtime_lock); tb_last_stamp = jiffy_stamp; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif /* * update the rtc when needed, this should be performed on the diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index ef44a3ec40dc8..66fe6f6711b58 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c @@ -277,6 +277,9 @@ int timer_interrupt(struct pt_regs * regs) write_seqlock(&xtime_lock); tb_last_stamp = lpaca->next_jiffy_update_tb; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif timer_sync_xtime( cur_tb ); timer_check_rtc(); write_sequnlock(&xtime_lock); diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 8f279421646f6..543e0d8817c6e 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -233,8 +233,10 @@ void account_ticks(struct pt_regs *regs) while (ticks--) update_process_times(user_mode(regs)); #else - while (ticks--) + while (ticks--) { do_timer(regs); + update_process_times(user_mode(regs)); + } #endif s390_do_profile(regs); } diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 7bb5da4607071..149803d26436e 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -266,6 +266,9 @@ static long last_rtc_update; static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c index b3738ed371d8f..9d73104f68177 100644 --- a/arch/sh64/kernel/time.c +++ b/arch/sh64/kernel/time.c @@ -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; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index c982473d1be04..918d3f23bdc83 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -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 */ pcic_clear_clock_irq(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif write_sequnlock(&xtime_lock); return IRQ_HANDLED; } diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index 60507d3948685..6af5019658bac 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c @@ -134,6 +134,10 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) clear_clock_irq(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif + /* Determine when to update the Mostek clock. */ if ((time_status & STA_UNSYNC) == 0 && diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index b50e16d492277..53bde9804ce75 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -462,6 +462,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) do { #ifndef CONFIG_SMP profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(regs)); #endif do_timer(regs); diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 5ce5668825fc7..aee0f7f1aeccc 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c @@ -169,11 +169,9 @@ void __const_udelay(um_udelay_t usecs) void timer_handler(int sig, union uml_pt_regs *regs) { -#ifdef CONFIG_SMP local_irq_disable(); update_process_times(user_context(UPT_SP(regs))); local_irq_enable(); -#endif if(current_thread->cpu == 0) timer_irq(regs); } diff --git a/arch/v850/kernel/time.c b/arch/v850/kernel/time.c index d0266de065dcb..f722a268238a6 100644 --- a/arch/v850/kernel/time.c +++ b/arch/v850/kernel/time.c @@ -56,6 +56,9 @@ static irqreturn_t timer_interrupt (int irq, void *dummy, struct pt_regs *regs) mach_tick (); do_timer (regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif profile_tick(CPU_PROFILING, regs); #if 0 /* diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index ee941842d7102..289b81dae486b 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c @@ -427,6 +427,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *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, diff --git a/include/asm-arm/arch-clps711x/time.h b/include/asm-arm/arch-clps711x/time.h index 10d1038f3cfdd..9cb27cd4e6ae9 100644 --- a/include/asm-arm/arch-clps711x/time.h +++ b/include/asm-arm/arch-clps711x/time.h @@ -30,6 +30,9 @@ p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_leds(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif do_profile(regs); return IRQ_HANDLED; } diff --git a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h index 2ecbfa7f12597..01729e4d0644e 100644 --- a/include/asm-arm/arch-integrator/time.h +++ b/include/asm-arm/arch-integrator/time.h @@ -107,6 +107,9 @@ integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_leds(); do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif do_profile(regs); return IRQ_HANDLED; diff --git a/include/asm-arm/arch-l7200/time.h b/include/asm-arm/arch-l7200/time.h index 31d791ac1d8cb..7b98b533e63a8 100644 --- a/include/asm-arm/arch-l7200/time.h +++ b/include/asm-arm/arch-l7200/time.h @@ -46,6 +46,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif do_profile(regs); RTC_RTCC = 0; /* Clear interrupt */ diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h index 9eb6c9dde893f..03dd13a48a8cb 100644 --- a/include/asm-i386/mach-default/do_timer.h +++ b/include/asm-i386/mach-default/do_timer.h @@ -16,6 +16,9 @@ static inline void do_timer_interrupt_hook(struct pt_regs *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, except when we simulate SMP mode on a uniprocessor diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h index 17287326962e9..33acd50fd9a8a 100644 --- a/include/asm-i386/mach-visws/do_timer.h +++ b/include/asm-i386/mach-visws/do_timer.h @@ -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); 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, except when we simulate SMP mode on a uniprocessor diff --git a/include/asm-i386/mach-voyager/do_timer.h b/include/asm-i386/mach-voyager/do_timer.h index 75c642f9af741..ae510e5d0d783 100644 --- a/include/asm-i386/mach-voyager/do_timer.h +++ b/include/asm-i386/mach-voyager/do_timer.h @@ -4,6 +4,9 @@ static inline void do_timer_interrupt_hook(struct pt_regs *regs) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif voyager_timer_interrupt(regs); } diff --git a/kernel/timer.c b/kernel/timer.c index e3c9b5fcd52f5..ac9386e22bd33 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -959,11 +959,6 @@ static inline void update_times(void) void do_timer(struct pt_regs *regs) { jiffies_64++; -#ifndef CONFIG_SMP - /* SMP process accounting uses the local APIC timer */ - - update_process_times(user_mode(regs)); -#endif update_times(); } -- 2.53.0