From 4ab080249a9f183254e39905e915442e3e7490d1 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 27 Jul 2004 16:41:01 +0000 Subject: 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 --- sys/alpha/include/critical.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sys/alpha') diff --git a/sys/alpha/include/critical.h b/sys/alpha/include/critical.h index 88d68e1..22ff08c 100644 --- a/sys/alpha/include/critical.h +++ b/sys/alpha/include/critical.h @@ -55,11 +55,9 @@ 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; - td = curthread; td->td_md.md_savecrit = intr_disable(); } @@ -71,18 +69,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; intr_restore(td->td_md.md_savecrit); } #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__ */ -- cgit v1.1