Re: [PATCH] cputime (1/6): move call to update_process_times.

2004-08-06 Thread Martin Schwidefsky
> > Wouldn't it be possible to move the #ifndef into sched.h?
>
> You can't simply define it to a nop in case of SMP, because
> there it is called from a different place, but we could
> have a separate version for UP and SMP in sched.h:
>
> void update_process_times(int user_tick);
> static inline void update_process_times_nonsmp(int user_tick)
> {
> #ifndef CONFIG_SMP
> update_process_times(user_tick);
> #endif
> }

Well, the #ifndef can just be removed for most of the architectures
because they are non-smp architectures anyway. But to avoid breaking
anything I decided to play safe and move the whole #ifndef block.
It's up to the arch maintainer to remove the #ifndef if the arch
doesn't need it.
The reason for moving the #ifndef is twofold. 1) it's just confusing
that a common code function depends on CONFIG_SMP in the way do_timer
does. do_timer should do just one thing, and not two but only if this
is a non-smp kernel. 2) do_timer and update_process_times needs to get
separated to make it possible to account cputime independent of the
xtime updates.

blue skies,
   Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: [EMAIL PROTECTED]

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: [PATCH] cputime (1/6): move call to update_process_times.

2004-08-05 Thread Alessandro Amici
Arnd,

On Thursday 05 August 2004 22:54, Arnd Bergmann wrote:
> void update_process_times(int user_tick);
> static inline void update_process_times_nonsmp(int user_tick)
> {
> #ifndef CONFIG_SMP
>   update_process_times(user_tick);
> #endif
> }

I'm sure you mean 'update_process_times_up' 8-)

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: [PATCH] cputime (1/6): move call to update_process_times.

2004-08-05 Thread Arnd Bergmann
On Donnerstag, 5. August 2004 21:57, Alessandro Amici wrote:
> I don't have enough knowledge to comment on the merit of the move to 
> architecture files, but the proliferation of #ifndef CONFIG_SMP looks really 
> ugly.

Yes, it does.

> Wouldn't it be possible to move the #ifndef into sched.h?

You can't simply define it to a nop in case of SMP, because
there it is called from a different place, but we could
have a separate version for UP and SMP in sched.h:

void update_process_times(int user_tick);
static inline void update_process_times_nonsmp(int user_tick)
{
#ifndef CONFIG_SMP
update_process_times(user_tick);
#endif
}

Arnd <><

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


pgp3dStr8hel8.pgp
Description: signature


[PATCH] cputime (1/6): move call to update_process_times.

2004-08-05 Thread Martin Schwidefsky
[PATCH] cputime (1/6): move call to update_process_times.

From: Martin Schwidefsky <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>

diffstat:
 arch/alpha/kernel/time.c |3 +++
 arch/arm/kernel/time.c   |3 +++
 arch/arm/mach-iop3xx/iq80310-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 -
 36 files changed, 98 insertions(+), 20 deletions(-)

diff -urN linux-2.6.8-rc3/arch/alpha/kernel/time.c 
linux-2.6.8-s390/arch/alpha/kernel/time.c
--- linux-2.6.8-rc3/arch/alpha/kernel/time.cThu Aug  5 18:39:48 2004
+++ linux-2.6.8-s390/arch/alpha/kernel/time.c   Thu Aug  5 18:40:21 2004
@@ -138,6 +138,9 @@

while (nticks > 0) {
do_timer(regs);
+#ifndef CONFIG_SMP
+   update_process_times(user_mode(regs));
+#endif
nticks--;
}

diff -urN linux-2.6.8-rc3/arch/arm/kernel/time.c 
linux-2.6.8-s390/arch/arm/kernel/time.c
--- linux-2.6.8-rc3/arch/arm/kernel/time.c  Thu Aug  5 18:39:48 2004
+++ linux-2.6.8-s390/arch/arm/kernel/time.c Thu Aug  5 18:40:21 2004
@@ -321,6 +321,9 @@
do_leds();
do_set_rtc();
do_timer(regs);
+#ifndef CONFIG_SMP
+   update_process_times(user_mode(regs));
+#endif
 }

 void (*init_arch_time)(void);
diff -urN linux-2.6.8-rc3/arch/arm/mach-iop3xx/iq80310-time.c 
linux-2.6.8-s390/arch/arm/mach-iop3xx/iq80310-time.c
--- linux-2.6.8-rc3/arch/arm/mach-iop3xx/iq80310-time.c Wed Jun 16 07:19:43 2004
+++ linux-2.6.8-s390/arch/arm/mach-iop3xx/iq80310-time.cThu Aug  5 18:40:21 
2004
@@ -97,6 +97,9 @@
*timer_en |= 2;

do_timer(regs);
+#ifndef CONFIG_SMP
+   update_process_times(user_mode(regs));
+#endif

return IRQ_HANDLED;
 }
diff -urN linux-2.6.8-rc3/arch/arm26/kernel/time.c 
linux-2.6.8-s390/arch/arm26/kernel/time.c
--- linux-2.6.8-rc3/arch/arm26/kernel/time.cWed Jun 16 07:19:42 2004
+++ linux-2.6.8-s390/arch/arm26/kernel/time.c   Thu Aug  5 18:40:21 2004
@@ -188,6 +188,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_set_rtc(); //FIME - EVERY timer IRQ?
 do_profile(regs);
return IRQ_HANDLED; //FIXME - is this right?
diff -urN linux-2.6.8-rc3/arch/cris/arch-v10/kernel/time.c 
linux-2.6.8-s390/arch/cris/arch-v10/kernel/time.c
--- linux-2.6.8-rc3/arch/cris/arch-v10/kernel/time.cThu Aug  5 18:39:48 2004
+++ linux-2.6.8-s390/arch/cris/arch-v10/kernel/time.c   Thu Aug  5 18:40:21 2004
@@ -227,6 +227,9 @@
/* 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 -urN linux-2.6.8-rc3/arch/h8300/kernel/time.c 
linux-2.6.8-s390/arch/h8300/kernel/time.c
--- linux-2.6.8-rc3/arch/h8300/kernel/time.cWed Jun 16 07:19:10 2004
+++ linux-2.6.8-s390/arch/h8300/kernel/time