From cd906fe3de95dfa7549f036f05b5a63e4bdfe07a Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 19 Nov 1999 16:49:30 +0000 Subject: Optimize two cases in the MP locking code. First, it is not necessary to use a locked cmpexg when unlocking a lock that we already hold, since nobody else can touch the lock while we hold it. Second, it is not necessary to use a locked cmpexg when locking a lock that we already hold, for the same reason. These changes will allow MP locks to be used recursively without impacting performance. Modify two procedures that are called only by assembly and are already NOPROF entries to pass a critical argument in %edx instead of on the stack, removing a significant amount of code from the critical path as a consequence. Reviewed by: Alfred Perlstein , Peter Wemm --- sys/amd64/include/apicreg.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/amd64/include') diff --git a/sys/amd64/include/apicreg.h b/sys/amd64/include/apicreg.h index 38c70709e7c2..be9de4f8fe1f 100644 --- a/sys/amd64/include/apicreg.h +++ b/sys/amd64/include/apicreg.h @@ -223,6 +223,7 @@ typedef struct IOAPIC ioapic_t; /* XXX these 2 don't really belong here... */ #define COUNT_FIELD 0x00ffffff /* count portion of the lock */ +#define CPU_FIELD 0xff000000 /* cpu portion of the lock */ #define FREE_LOCK 0xffffffff /* value of lock when free */ /* -- cgit v1.3