diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-14 01:20:45 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-14 01:20:45 +0000 |
commit | 49f26568d7feceb731dc1f2f31a6d8bc5559c5f3 (patch) | |
tree | 53d0a72336c5d2efabdb23d9878171951522f1ce /sys/arch/sparc64/include | |
parent | 2e52f43e9231ef2fca7724a1f0f62d2b18fa295a (diff) |
rework mplock as ticket locks instead of spinlocks. this provides
fairer access to the kernel lock (which suffers very heavy contention
at the moment).
i wrote this at n2k14 and reworked it shortly after to use the mi
atomic ops api when that was agreed on. ive been running it on my
systems ever since.
the version before the atomic op tweaks was tested by kettenis@
n2k14 (deraadt@ and kettenis@ in particular if i recall correctly)
oked this going in after 5.5
Diffstat (limited to 'sys/arch/sparc64/include')
-rw-r--r-- | sys/arch/sparc64/include/mplock.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/sparc64/include/mplock.h b/sys/arch/sparc64/include/mplock.h index aa133e36686..7b7d9cc7a59 100644 --- a/sys/arch/sparc64/include/mplock.h +++ b/sys/arch/sparc64/include/mplock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mplock.h,v 1.2 2007/11/27 23:29:57 kettenis Exp $ */ +/* $OpenBSD: mplock.h,v 1.3 2014/03/14 01:20:44 dlg Exp $ */ /* * Copyright (c) 2004 Niklas Hallqvist. All rights reserved. @@ -27,9 +27,15 @@ #ifndef _MACHINE_MPLOCK_H_ #define _MACHINE_MPLOCK_H_ +struct __mp_lock_cpu { + volatile u_int mplc_ticket; + volatile u_int mplc_depth; +}; + struct __mp_lock { - volatile struct cpu_info *mpl_cpu; - volatile long mpl_count; + struct __mp_lock_cpu mpl_cpus[MAXCPUS]; + volatile u_int mpl_ticket; + volatile u_int mpl_users; }; #ifndef _LOCORE |