diff options
author | Matthew Dillon <dillon@FreeBSD.org> | 1999-11-19 22:47:19 +0000 |
---|---|---|
committer | Matthew Dillon <dillon@FreeBSD.org> | 1999-11-19 22:47:19 +0000 |
commit | f94f8efc61f135820d2c086e36422f19b932f20c (patch) | |
tree | f3084876b5168e2efaad18acae292a652d87bb93 /sys | |
parent | 2996376ab518d7c1c4764bc62f273ca9bef10cd0 (diff) | |
download | src-f94f8efc61f135820d2c086e36422f19b932f20c.tar.gz src-f94f8efc61f135820d2c086e36422f19b932f20c.zip |
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 <bright@wintelcom.net>, Peter Wemm <peter@netplex.com.au>
Notes
Notes:
svn path=/head/; revision=53435
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/include/lock.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/i386/include/lock.h b/sys/i386/include/lock.h index 1faff8261b32..25c54e48f8cf 100644 --- a/sys/i386/include/lock.h +++ b/sys/i386/include/lock.h @@ -55,9 +55,8 @@ add $4, %esp #define ISR_RELLOCK \ - pushl $_mp_lock ; /* GIANT_LOCK */ \ - call _MPrellock ; \ - add $4, %esp + movl $_mp_lock,%edx ; /* GIANT_LOCK */ \ + call _MPrellock_edx /* * Protects the IO APIC and apic_imen as a critical region. |