aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/include/critical.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2004-07-27 16:41:01 +0000
committerRobert Watson <rwatson@FreeBSD.org>2004-07-27 16:41:01 +0000
commit1a8cfbc45096bb34daeddc44ba75ff8377e9e5c8 (patch)
treede9f7b08c7ab02bd97e32e53b40a626c8216f214 /sys/sparc64/include/critical.h
parentf66145c6bd8178a68fb3e0e702d0473469722fba (diff)
downloadsrc-1a8cfbc45096bb34daeddc44ba75ff8377e9e5c8.tar.gz
src-1a8cfbc45096bb34daeddc44ba75ff8377e9e5c8.zip
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
Notes
Notes: svn path=/head/; revision=132700
Diffstat (limited to 'sys/sparc64/include/critical.h')
-rw-r--r--sys/sparc64/include/critical.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/sparc64/include/critical.h b/sys/sparc64/include/critical.h
index fb5fa7088fc3..381ec453602a 100644
--- a/sys/sparc64/include/critical.h
+++ b/sys/sparc64/include/critical.h
@@ -55,12 +55,10 @@ void cpu_critical_fork_exit(void);
* of td_critnest, prior to it being incremented to 1.
*/
static __inline void
-cpu_critical_enter(void)
+cpu_critical_enter(struct thread *td)
{
- struct thread *td;
critical_t pil;
- td = curthread;
pil = rdpr(pil);
wrpr(pil, 0, 14);
td->td_md.md_savecrit = pil;
@@ -75,18 +73,16 @@ cpu_critical_enter(void)
* exiting the last critical section.
*/
static __inline void
-cpu_critical_exit(void)
+cpu_critical_exit(struct thread *td)
{
- struct thread *td;
- td = curthread;
wrpr(pil, td->td_md.md_savecrit, 0);
}
#else /* !__GNUC__ */
-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__ */