Re: [PATCH] taskstats scaled time cleanup

Previous thread: is CONFIG_APUS sufficiently deceased to be removed? by Robert P. J. Day on Wednesday, October 24, 2007 - 2:51 am. (3 messages)

Next thread: sysfs sys/kernel/ namespace (was Re: [PATCH 0/2] add new notifier function ,take2) by Nick Piggin on Wednesday, October 24, 2007 - 2:48 am. (5 messages)
To: <paulus@...>, <akpm@...>, <linux390@...>
Cc: <linux-kernel@...>, <linuxppc-dev@...>, <linux-s390@...>, Balbir Singh <balbir@...>
Date: Wednesday, October 24, 2007 - 2:54 am

This moves the ability to scale cputime into generic code. This
allows us to fix the issue in kernel/timer.c (noticed by Balbir) where
we could only add an unscaled value to the scaled utime/stime.

This adds a cputime_to_scaled function. As before, the POWERPC
version does the scaling based on the last SPURR/PURR ratio
calculated. The generic and s390 (only other arch to implement
asm/cputime.h) versions are both NOPs.

Also moves the SPURR and PURR snapshots closer.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
arch/powerpc/kernel/time.c | 14 +++++++-------
include/asm-generic/cputime.h | 1 +
include/asm-powerpc/cputime.h | 14 ++++++++++++++
include/asm-powerpc/paca.h | 2 --
include/asm-s390/cputime.h | 1 +
kernel/timer.c | 9 +++++----
6 files changed, 28 insertions(+), 13 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/time.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/time.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/time.c
@@ -66,6 +66,7 @@
#include <asm/smp.h>
#include <asm/vdso_datapage.h>
#include <asm/firmware.h>
+#include <asm/cputime.h>
#ifdef CONFIG_PPC_ISERIES
#include <asm/iseries/it_lp_queue.h>
#include <asm/iseries/hv_call_xm.h>
@@ -186,6 +187,8 @@ u64 __cputime_sec_factor;
EXPORT_SYMBOL(__cputime_sec_factor);
u64 __cputime_clockt_factor;
EXPORT_SYMBOL(__cputime_clockt_factor);
+DEFINE_PER_CPU(unsigned long, cputime_last_delta);
+DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);

static void calc_cputime_factors(void)
{
@@ -232,9 +235,9 @@ void account_system_vtime(struct task_st

local_irq_save(flags);
now = read_purr();
+ nowscaled = read_spurr(now);
delta = now - get_paca()->startpurr;
get_paca()->startpurr = now;
- nowscaled = read_spurr(now);
deltascaled = nowscaled - get_paca()->startspurr;
get_paca()->startspurr = nowsc...

To: Michael Neuling <mikey@...>
Cc: <paulus@...>, <linux390@...>, <linux-kernel@...>, <linuxppc-dev@...>, <linux-s390@...>, <balbir@...>
Date: Wednesday, October 24, 2007 - 7:33 pm

[Empty message]
To: Michael Neuling <mikey@...>
Cc: <paulus@...>, <akpm@...>, <linux390@...>, <linux-kernel@...>, <linuxppc-dev@...>, <linux-s390@...>
Date: Wednesday, October 24, 2007 - 5:52 am

[Empty message]
Previous thread: is CONFIG_APUS sufficiently deceased to be removed? by Robert P. J. Day on Wednesday, October 24, 2007 - 2:51 am. (3 messages)

Next thread: sysfs sys/kernel/ namespace (was Re: [PATCH 0/2] add new notifier function ,take2) by Nick Piggin on Wednesday, October 24, 2007 - 2:48 am. (5 messages)