diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-07-27 16:41:01 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-07-27 16:41:01 +0000 |
commit | 4ab080249a9f183254e39905e915442e3e7490d1 (patch) | |
tree | de9f7b08c7ab02bd97e32e53b40a626c8216f214 /sys/i386 | |
parent | 8feaacec0cd088d29781dc3559e0d2adef8602a3 (diff) | |
download | FreeBSD-src-4ab080249a9f183254e39905e915442e3e7490d1.zip FreeBSD-src-4ab080249a9f183254e39905e915442e3e7490d1.tar.gz |
Pass a thread argument into cpu_critical_{enter,exit}() rather than
dereference curthread. It is called only from critical_{enter,exit}(),
which already dereferences curthread. This doesn't seem to affect SMP
performance in my benchmarks, but improves MySQL transaction throughput
by about 1% on UP on my Xeon.
Head nodding: jhb, bmilekic
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/critical.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/i386/include/critical.h b/sys/i386/include/critical.h index 8ddc7ef..9826988 100644 --- a/sys/i386/include/critical.h +++ b/sys/i386/include/critical.h @@ -59,9 +59,9 @@ void cpu_critical_fork_exit(void); * is non-zero will be deferred. */ static __inline void -cpu_critical_enter(void) +cpu_critical_enter(struct thread *td) { - curthread->td_md.md_savecrit = intr_disable(); + td->td_md.md_savecrit = intr_disable(); } /* @@ -76,15 +76,15 @@ cpu_critical_enter(void) * code for us, so we do not have to do anything fancy. */ static __inline void -cpu_critical_exit(void) +cpu_critical_exit(struct thread *td) { - intr_restore(curthread->td_md.md_savecrit); + intr_restore(td->td_md.md_savecrit); } #else /* !(__GNUC__ || __INTEL_COMPILER) */ -void cpu_critical_enter(void); -void cpu_critical_exit(void); +void cpu_critical_enter(struct thread *td); +void cpu_critical_exit(struct thread *td); #endif /* __GNUC__ || __INTEL_COMPILER */ |