diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2003-06-26 19:43:55 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-06-26 19:43:55 -0700 |
| commit | 6d338bb299e65cc7a5d86fce60daa03a81ffb41d (patch) | |
| tree | 0a55c58ed879bafbfb7d970af40011c226b7108d /kernel/fork.c | |
| parent | 5e49d31efe65aa18e9643c0174353a3aacc234fa (diff) | |
[PATCH] Use Local Percpu Macros for Local Percpu Variables
In general, it is more better to use get_cpu_var() and __get_cpu_var()
to access per-cpu variables on this CPU than to use smp_processor_id()
and per_cpu(). In the current default implemention they are equivalent,
but on IA64 the former is already faster, and other archs will follow.
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 5ef2dca02354..2abbc9c2da23 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1006,7 +1006,7 @@ struct task_struct *copy_process(unsigned long clone_flags, attach_pid(p, PIDTYPE_PGID, p->pgrp); attach_pid(p, PIDTYPE_SID, p->session); if (p->pid) - per_cpu(process_counts, smp_processor_id())++; + __get_cpu_var(process_counts)++; } else link_pid(p, p->pids + PIDTYPE_TGID, &p->group_leader->pids[PIDTYPE_TGID].pid); |
