summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2003-07-06 23:01:42 -0700
committerSteve French <cifs.adm@hostme.bitkeeper.com>2003-07-06 23:01:42 -0700
commitb993be7e4517f328fd6bd8bcea2f038c894a292e (patch)
tree5c57830158cec1d40c81b85e23353bad4647184d /include
parent163feb5818080346b1e819ca8f8fcd68eac5e593 (diff)
[PATCH] Make kstat_this_cpu in terms of __get_cpu_var and use it
kstat_this_cpu() is defined in terms of per_cpu instead of __get_cpu_var. This patch changes that, and uses it everywhere appropriate. The sched.c change puts it in a local variable, which helps gcc generate better code.
Diffstat (limited to 'include')
-rw-r--r--include/linux/kernel_stat.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 88425e94cdc5..9971827a3c4b 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -31,7 +31,8 @@ struct kernel_stat {
DECLARE_PER_CPU(struct kernel_stat, kstat);
#define kstat_cpu(cpu) per_cpu(kstat, cpu)
-#define kstat_this_cpu kstat_cpu(smp_processor_id())
+/* Must have preemption disabled for this to be meaningful. */
+#define kstat_this_cpu __get_cpu_var(kstat)
extern unsigned long nr_context_switches(void);