diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-12 16:21:09 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-26 07:47:57 -0700 |
commit | f64d00b4b1486643545e9854db3a1c5d361c5d04 (patch) | |
tree | 897b875794bdf680ea27787034a7d07899d78b5d /scripts/mkcompile_h | |
parent | 76eeb36bb43163c0aa49be6c952e2f4246e7f582 (diff) | |
download | kernel-crypto-f64d00b4b1486643545e9854db3a1c5d361c5d04.tar.gz kernel-crypto-f64d00b4b1486643545e9854db3a1c5d361c5d04.tar.xz kernel-crypto-f64d00b4b1486643545e9854db3a1c5d361c5d04.zip |
x86-32: clean up rwsem inline asm statements
commit 59c33fa7791e9948ba467c2b83e307a0d087ab49 upstream.
This makes gcc use the right register names and instruction operand sizes
automatically for the rwsem inline asm statements.
So instead of using "(%%eax)" to specify the memory address that is the
semaphore, we use "(%1)" or similar. And instead of forcing the operation
to always be 32-bit, we use "%z0", taking the size from the actual
semaphore data structure itself.
This doesn't actually matter on x86-32, but if we want to use the same
inline asm for x86-64, we'll need to have the compiler generate the proper
64-bit names for the registers (%rax instead of %eax), and if we want to
use a 64-bit counter too (in order to avoid the 15-bit limit on the
write counter that limits concurrent users to 32767 threads), we'll need
to be able to generate instructions with "q" accesses rather than "l".
Since this header currently isn't enabled on x86-64, none of that matters,
but we do want to use the xadd version of the semaphores rather than have
to take spinlocks to do a rwsem. The mm->mmap_sem can be heavily contended
when you have lots of threads all taking page faults, and the fallback
rwsem code that uses a spinlock performs abysmally badly in that case.
[ hpa: modified the patch to skip size suffixes entirely when they are
redundant due to register operands. ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <alpine.LFD.2.00.1001121613560.17145@localhost.localdomain>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'scripts/mkcompile_h')
0 files changed, 0 insertions, 0 deletions