aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2009-07-29 06:15:29 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-03 08:48:36 -0400
commita42548a18866e87092db93b771e6c5b060d78401 (patch)
tree897acf5794920ec9c6fd7f87af63908d0c1988f9 /arch/s390
parentd1e3b6d195770bd422e3229b88edfc154b6a27dd (diff)
cputime: Optimize jiffies_to_cputime(1)
For powerpc with CONFIG_VIRT_CPU_ACCOUNTING jiffies_to_cputime(1) is not compile time constant and run time calculations are quite expensive. To optimize we use precomputed value. For all other architectures is is preprocessor definition. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> LKML-Reference: <1248862529-6063-5-git-send-email-sgruszka@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/cputime.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 7a3817a656df..24b1244aadb9 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -42,6 +42,7 @@ __div(unsigned long long n, unsigned int base)
42#endif /* __s390x__ */ 42#endif /* __s390x__ */
43 43
44#define cputime_zero (0ULL) 44#define cputime_zero (0ULL)
45#define cputime_one_jiffy jiffies_to_cputime(1)
45#define cputime_max ((~0UL >> 1) - 1) 46#define cputime_max ((~0UL >> 1) - 1)
46#define cputime_add(__a, __b) ((__a) + (__b)) 47#define cputime_add(__a, __b) ((__a) + (__b))
47#define cputime_sub(__a, __b) ((__a) - (__b)) 48#define cputime_sub(__a, __b) ((__a) - (__b))