OpenBSD CVS

CVS log for src/sys/kern/kern_lock.c


[BACK] Up to [local] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.74 / (download) - annotate - [select for diffs], Wed May 29 18:55:45 2024 UTC (12 days, 16 hours ago) by claudio
Branch: MAIN
CVS Tags: HEAD
Changes since 1.73: +1 -4 lines
Diff to previous 1.73 (colored)

Convert SCHED_LOCK from a recursive kernel lock to a mutex.

Over the last weeks the last SCHED_LOCK recursion was removed so this
is now possible and will allow to split up the SCHED_LOCK in a upcoming
step.

Instead of implementing an MP and SP version of SCHED_LOCK this just
always uses the mutex implementation.
While this makes the local s argument unused (the spl is now tracked by
the mutex itself) it is still there to keep this diff minimal.

Tested by many.
OK jca@ mpi@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Mar 26 18:18:30 2024 UTC (2 months, 2 weeks ago) by bluhm
Branch: MAIN
Changes since 1.72: +10 -8 lines
Diff to previous 1.72 (colored)

Improve spinning in mtx_enter().

Instead of calling mtx_enter_try() in each spinning loop, do it
only if the result of a lockless read indicates that the mutex has
been released.  This avoids some expensive atomic compare-and-swap
operations.  Up to 5% reduction of spinning time during kernel build
can been seen on a 8 core amd64 machine.  On other machines there
was no visible effect.

Test on powerpc64 has revealed a bug in mtx_owner declaration.  Not
the variable was volatile, but the object it points to.  Move the
volatile declaration in struct mutex to avoid a hang when going to
multiuser.

from Mateusz Guzik; input kettenis@ jca@; OK mpi@

Revision 1.72 / (download) - annotate - [select for diffs], Tue Apr 26 15:31:14 2022 UTC (2 years, 1 month ago) by dv
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Bump __mp_lock_spinout to INT_MAX.

The previous value set years ago was causing amd64 kernels to spin
out when run with MP_LOCKDEBUG during boot.

ok kettenis@

Revision 1.71 / (download) - annotate - [select for diffs], Thu Mar 5 09:28:31 2020 UTC (4 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored)

The 'lock spun out' db_printf needs a newline. All other MP_LOCKDEBUG
messages do have the newline already.
OK anton@ kettenis@

Revision 1.70 / (download) - annotate - [select for diffs], Tue Jun 4 15:41:02 2019 UTC (5 years ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.69: +5 -1 lines
Diff to previous 1.69 (colored)

Let SP kernel work with WITNESS. The necessary instrumentation was
missing from the SP variant of mtx_enter() and mtx_enter_try().
mtx_leave() was correct already.

Prompted by and OK patrick@

Revision 1.69 / (download) - annotate - [select for diffs], Tue Apr 23 13:35:12 2019 UTC (5 years, 1 month ago) by visa
Branch: MAIN
Changes since 1.68: +25 -55 lines
Diff to previous 1.68 (colored)

Remove file name and line number output from witness(4)

Reduce code clutter by removing the file name and line number output
from witness(4). Typically it is easy enough to locate offending locks
using the stack traces that are shown in lock order conflict reports.
Tricky cases can be tracked using sysctl kern.witness.locktrace=1 .

This patch additionally removes the witness(4) wrapper for mutexes.
Now each mutex implementation has to invoke the WITNESS_*() macros
in order to utilize the checker.

Discussed with and OK dlg@, OK mpi@

Revision 1.68 / (download) - annotate - [select for diffs], Sat Mar 23 05:30:16 2019 UTC (5 years, 2 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.67: +53 -1 lines
Diff to previous 1.67 (colored)

Add a simple spinning mutex for ddb. Unlike mutex(9), this lock keeps
on spinning even if `db_active' or `panicstr' has been set. The new
mutex also disables IPIs in the critical section.

OK mpi@ patrick@

Revision 1.67 / (download) - annotate - [select for diffs], Mon Feb 25 04:50:25 2019 UTC (5 years, 3 months ago) by visa
Branch: MAIN
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

Fix memory barrier in __mtx_leave(). membar_exit_before_atomic() cannot
be used in the routine because there is no subsequent atomic operation.
membar_exit() has to be used instead.

The mistake has not caused problems because on most platforms
membar_exit_before_atomic() is membar_exit(). Only amd64 and i386 have
a dedicated membar_exit_before_atomic(), and their exit barriers are
no-ops.

OK dlg@

Revision 1.66 / (download) - annotate - [select for diffs], Fri Jun 15 13:59:53 2018 UTC (5 years, 11 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.65: +4 -6 lines
Diff to previous 1.65 (colored)

Simplify #ifdefs. The kernel_lock symbol is no longer needed when
building a uniprocessor kernel with WITNESS.

OK mpi@

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jun 8 15:38:15 2018 UTC (6 years ago) by guenther
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

Constipate all the struct lock_type's so they go into .rodata

ok visa@

Revision 1.64 / (download) - annotate - [select for diffs], Mon May 14 12:31:21 2018 UTC (6 years ago) by mpi
Branch: MAIN
Changes since 1.63: +7 -1 lines
Diff to previous 1.63 (colored)

Stopping counting and reporting CPU time spent spinning on a lock as
system time.

Introduce a new CP_SPIN "scheduler state" and modify userland tools
to display the % of timer a CPU spents spinning.

Based on a diff from jmatthew@, ok pirofti@, bluhm@, visa@, deraadt@

Revision 1.63 / (download) - annotate - [select for diffs], Thu Apr 26 06:51:48 2018 UTC (6 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.62: +6 -7 lines
Diff to previous 1.62 (colored)

Drop into ddb(4) if pmap_tlb_shoot*() take too much time in MP_LOCKDEBUG
kernels.

While here sync all MP_LOCKDEBUG/while loops.

ok mlarkin@, visa@

Revision 1.62 / (download) - annotate - [select for diffs], Wed Apr 25 10:30:41 2018 UTC (6 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.61: +5 -5 lines
Diff to previous 1.61 (colored)

Teach mtx_enter_try(9) to avoid deadlocks after a panic.

ok deraadt@

Revision 1.61 / (download) - annotate - [select for diffs], Tue Mar 27 08:32:29 2018 UTC (6 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.60: +13 -1 lines
Diff to previous 1.60 (colored)

Try harder to execute code protected by mutexes after entering ddb(4).

Should prevent a panic after panic reported by mlarkin@.

ok mlarkin@, visa@

Revision 1.60 / (download) - annotate - [select for diffs], Tue Mar 20 15:45:32 2018 UTC (6 years, 2 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

Do not panic from ddb(4) when a lock requirement isn't fulfilled.

Extend the logic already present for panic() to any DDB-related
operation such that if ddb(4) is entered because of a fault or
other trap it is still possible to call 'boot reboot'.

While here stop printing splassert() messages as well, to not fill
the buffer.

ok visa@, deraadt@

Revision 1.59 / (download) - annotate - [select for diffs], Mon Feb 19 09:18:00 2018 UTC (6 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored)

Include <sys/mutex.h> directly instead of relying on other headers to
include it.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Feb 19 09:08:13 2018 UTC (6 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.57: +6 -5 lines
Diff to previous 1.57 (colored)

Directly include sys/mplock.h when needed instead of depending on
indirect inclusion.  Fixes non-MULTIPROCESSOR WITNESS build.

ok visa@ mpi@

Revision 1.57 / (download) - annotate - [select for diffs], Wed Feb 14 08:55:12 2018 UTC (6 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.56: +51 -1 lines
Diff to previous 1.56 (colored)

Put WITNESS only functions with the rest of the locking primitives.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Feb 10 12:59:24 2018 UTC (6 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.55: +2 -16 lines
Diff to previous 1.55 (colored)

Merge license blocks now that they are identical.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Feb 10 12:53:22 2018 UTC (6 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.54: +11 -20 lines
Diff to previous 1.54 (colored)

Artur Grabowski agreed to relicense his C mutex implementation under ISC.

This will prevent a copyright-o-rama in kern_lock.c

Revision 1.54 / (download) - annotate - [select for diffs], Thu Feb 8 12:57:24 2018 UTC (6 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.53: +1 -35 lines
Diff to previous 1.53 (colored)

Remove CSRG copyright, there isn't any code left from Berkeley here.

In 2016 natano@ removed the last two functions remaining from the CSRG
time: lockinit() and lockstatus().  At that time they were already wrappers
around recursive rwlocks functions from thib@ that tedu@ committed in 2013.

ok deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Thu Jan 25 15:06:29 2018 UTC (6 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.52: +136 -2 lines
Diff to previous 1.52 (colored)

Move common mutex implementations to a MI place.

Archs not yet converted can to the jump by defining __USE_MI_MUTEX.

ok visa@

Revision 1.52 / (download) - annotate - [select for diffs], Mon Dec 4 09:51:03 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.51: +7 -7 lines
Diff to previous 1.51 (colored)

Change __mp_lock_held() to work with an arbitrary CPU info structure and
extend ddb(4) "ps /o" output to print which CPU is currently holding the
KERNEL_LOCK().

Tested by dhill@, ok visa@

Revision 1.51 / (download) - annotate - [select for diffs], Tue Oct 17 14:25:35 2017 UTC (6 years, 7 months ago) by visa
Branch: MAIN
Changes since 1.50: +173 -9 lines
Diff to previous 1.50 (colored)

Add a machine-independent implementation for the mplock.
This reduces code duplication and makes it easier to instrument
lock primitives.

The MI mplock uses the ticket lock code that has been in use
on amd64, i386 and sparc64. These are the architectures that now
switch to the MI code.

The lock_machdep.c files are unhooked from the build but not
removed yet, in case something goes wrong.

OK mpi@, kettenis@

Revision 1.50 / (download) - annotate - [select for diffs], Mon Oct 9 08:16:13 2017 UTC (6 years, 8 months ago) by mpi
Branch: MAIN
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored)

Make _kernel_lock_held() always succeed after panic(9).

ok visa@

Revision 1.49 / (download) - annotate - [select for diffs], Thu Apr 20 15:06:47 2017 UTC (7 years, 1 month ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.48: +1 -3 lines
Diff to previous 1.48 (colored)

Drop unnecessary headers. This fixes kernel build on platforms
without <machine/mplock.h>.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Apr 20 13:20:17 2017 UTC (7 years, 1 month ago) by visa
Branch: MAIN
Changes since 1.47: +28 -2 lines
Diff to previous 1.47 (colored)

Hook up mplock to witness(4) on amd64 and i386.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Jun 19 11:54:33 2016 UTC (7 years, 11 months ago) by natano
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.46: +1 -58 lines
Diff to previous 1.46 (colored)

Remove the lockmgr() API. It is only used by filesystems, where it is a
trivial change to use rrw locks instead. All it needs is LK_* defines
for the RW_* flags.

tested by naddy and sthen on package building infrastructure
input and ok jmc mpi tedu

Revision 1.46 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:25 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.45: +1 -2 lines
Diff to previous 1.45 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jul 13 15:46:21 2014 UTC (9 years, 11 months ago) by uebayasi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.44: +7 -1 lines
Diff to previous 1.44 (colored)

KERNEL_ASSERT_LOCKED(9): Assertion for kernel lock (Rev. 3)

This adds a new assertion macro, KERNEL_ASSERT_LOCKED(), to assert that
kernel_lock is held.  In the long process of removing kernel_lock, there will
be a lot (hundreds or thousands) of use of this; virtually almost all functions
in !MP-safe subsystems should have this assertion.  Thus this assertion should
have a short, good name.

Not only that "KERNEL_ASSERT_LOCKED" is consistent with other KERNEL_* and
SCHED_ASSERT_LOCKED() macros.

Input from dlg@ guenther@ kettenis@.

OK dlg@ guenther@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jul 9 13:32:00 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.43: +3 -1 lines
Diff to previous 1.43 (colored)

Teach rw_status() and rrw_status() to return LK_EXCLOTHER if it's write
locked by a different thread.  Teach lockstatus() to return LK_EXCLUSIVE
if an exclusive lock is held by some other thread.

ok beck@ tedu@

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jan 21 01:48:44 2014 UTC (10 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

bzero -> memset

Revision 1.42 / (download) - annotate - [select for diffs], Mon May 6 16:37:55 2013 UTC (11 years, 1 month ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.41: +10 -2 lines
Diff to previous 1.41 (colored)

restore original gangster lockstatus return values for compat

Revision 1.41 / (download) - annotate - [select for diffs], Wed May 1 17:18:55 2013 UTC (11 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

a few tweaks noticed by jsing

Revision 1.40 / (download) - annotate - [select for diffs], Wed May 1 17:13:05 2013 UTC (11 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.39: +30 -280 lines
Diff to previous 1.39 (colored)

exorcise lockmgr. the api remains, but is now backed by recursive rwlocks.
originally by thib.
ok deraadt jsing and anyone who tested

Revision 1.39 / (download) - annotate - [select for diffs], Thu Mar 28 16:55:25 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

do not include machine/cpu.h from a .c file; it is the responsibility of
.h files to pull it in, if needed
ok tedu

Revision 1.38 / (download) - annotate - [select for diffs], Sun Aug 28 02:35:34 2011 UTC (12 years, 9 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.37: +8 -7 lines
Diff to previous 1.37 (colored)

lockmgr() wants to use a different address for the wchan when draining
the lock, but a change in member ordering meant it was using the same
address.  Explicitly use different members instead of mixing address
of member and address of the lock itself.

ok miod@

Revision 1.37 / (download) - annotate - [select for diffs], Wed Jul 6 21:41:37 2011 UTC (12 years, 11 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.36: +1 -18 lines
Diff to previous 1.36 (colored)

Clean up after P_BIGLOCK removal.
KERNEL_PROC_LOCK -> KERNEL_LOCK
KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK

oga@ ok

Revision 1.36 / (download) - annotate - [select for diffs], Wed Jul 6 01:49:42 2011 UTC (12 years, 11 months ago) by art
Branch: MAIN
Changes since 1.35: +1 -3 lines
Diff to previous 1.35 (colored)

Stop using the P_BIGLOCK flag to figure out when we should release the
biglock in mi_switch and just check if we're holding the biglock.

The idea is that the first entry point into the kernel uses KERNEL_PROC_LOCK
and recursive calls use KERNEL_LOCK. This assumption is violated in at
least one place and has been causing confusion for lots of people.

Initial bug report and analysis from Pedro.

kettenis@ beck@ oga@ thib@ dlg@ ok

Revision 1.35 / (download) - annotate - [select for diffs], Mon Apr 26 05:48:17 2010 UTC (14 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.34: +7 -415 lines
Diff to previous 1.34 (colored)

cut down simple locks (so simple that they don't even lock) to the point
where there is almost nothing left to them, so that we can continue getting
rid of them
ok oga

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jan 14 23:12:11 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

fix typos in comments, no code changes;
from Brad Tilley <brad at 16systems dot com>;
ok oga@

Revision 1.33 / (download) - annotate - [select for diffs], Wed Mar 25 21:20:26 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.32: +1 -5 lines
Diff to previous 1.32 (colored)

ntfs was the last user, LK_SLEEFAIL can die now.

ok blambert@

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jan 15 07:48:55 2009 UTC (15 years, 4 months ago) by grange
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Surround WEHOLDIT() macro with braces to make it more safe.
No binary change.

ok otto@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Nov 26 15:23:26 2007 UTC (16 years, 6 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.30: +1 -20 lines
Diff to previous 1.30 (colored)

Remove some dead code that is confusing my greps.

Revision 1.30 / (download) - annotate - [select for diffs], Thu May 31 22:07:53 2007 UTC (17 years ago) by thib
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.29: +1 -15 lines
Diff to previous 1.29 (colored)

remove p_lock from struct proc; unused debug goo for lockmgr,
wich gets set and never checked etc...

ok art@,tedu@

Revision 1.29 / (download) - annotate - [select for diffs], Fri May 11 10:06:56 2007 UTC (17 years, 1 month ago) by pedro
Branch: MAIN
Changes since 1.28: +2 -3 lines
Diff to previous 1.28 (colored)

Don't use LK_CANRECURSE for the kernel lock, okay miod@ art@

Revision 1.28 / (download) - annotate - [select for diffs], Tue May 8 20:25:56 2007 UTC (17 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

lockmgr_printinfo() is only called from #ifdef DIAGNOSTIC positions, so #ifdef DIAGNOSTIC it too

Revision 1.27 / (download) - annotate - [select for diffs], Thu Apr 12 22:20:14 2007 UTC (17 years, 2 months ago) by thib
Branch: MAIN
Changes since 1.26: +3 -23 lines
Diff to previous 1.26 (colored)

Remove the lk_interlock from struct lock; Also remove the LK_INTERLOCK
flag. This effectively makes the simplelock argument to lockmgr() fluff.

ok miod@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Apr 11 12:06:37 2007 UTC (17 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.25: +8 -66 lines
Diff to previous 1.25 (colored)

lockmgr keeps losing code, call 911!

ok pedro@ art@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Mar 15 10:22:30 2007 UTC (17 years, 3 months ago) by art
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

Since p_flag is often manipulated in interrupts and without biglock
it's a good idea to use atomic.h operations on it. This mechanic
change updates all bit operations on p_flag to atomic_{set,clear}bits_int.

Only exception is that P_OWEUPC is set by MI code before calling
need_proftick and it's automatically cleared by ADDUPC. There's
no reason for MD handling of that flag since everyone handles it the
same way.

kettenis@ ok

Revision 1.24 / (download) - annotate - [select for diffs], Wed Feb 14 00:53:48 2007 UTC (17 years, 4 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@

Revision 1.23 / (download) - annotate - [select for diffs], Sat Feb 3 16:48:23 2007 UTC (17 years, 4 months ago) by miod
Branch: MAIN
Changes since 1.22: +46 -385 lines
Diff to previous 1.22 (colored)

Remove unused functionality from lockmgr():
- LK_EXCLUPGRADE is never used.
- LK_REENABLE is never used.
- LK_SETRECURSE is never used. Because of this, the lk_recurselevel
  field is always zero, so it can be removed to.
- the spinlock version (and LK_SPIN) is never used, since it was decided
  to use different locking structure for MP-safe protection.

Tested by many

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jan 3 15:34:21 2006 UTC (18 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.21: +1 -6 lines
Diff to previous 1.21 (colored)

remove duplicate comment;
from thordur i. bjornsson;

Revision 1.21 / (download) - annotate - [select for diffs], Mon Nov 28 00:14:28 2005 UTC (18 years, 6 months ago) by jsg
Branch: MAIN
Changes since 1.20: +9 -29 lines
Diff to previous 1.20 (colored)

ansi/deregister.
'go for it' deraadt@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Nov 19 02:18:01 2005 UTC (18 years, 6 months ago) by pedro
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Remove unnecessary lockmgr() archaism that was costing too much in terms
of panics and bugfixes. Access curproc directly, do not expect a process
pointer as an argument. Should fix many "process context required" bugs.
Incentive and okay millert@, okay marc@. Various testing, thanks.

Revision 1.19 / (download) - annotate - [select for diffs], Sun May 29 03:20:41 2005 UTC (19 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.18: +68 -0 lines
Diff to previous 1.18 (colored)

sched work by niklas and art backed out; causes panics

Revision 1.18 / (download) - annotate - [select for diffs], Wed May 25 23:17:47 2005 UTC (19 years ago) by niklas
Branch: MAIN
Changes since 1.17: +1 -69 lines
Diff to previous 1.17 (colored)

This patch is mortly art's work and was done *a year* ago.  Art wants to thank
everyone for the prompt review and ok of this work ;-)  Yeah, that includes me
too, or maybe especially me.  I am sorry.

Change the sched_lock to a mutex. This fixes, among other things, the infamous
"telnet localhost &" problem.  The real bug in that case was that the sched_lock
which is by design a non-recursive lock, was recursively acquired, and not
enough releases made us hold the lock in the idle loop, blocking scheduling
on the other processors.  Some of the other processors would hold the biglock though,
which made it impossible for cpu 0 to enter the kernel...  A nice deadlock.
Let me just say debugging this for days just to realize that it was all fixed
in an old diff noone ever ok'd was somewhat of an anti-climax.

This diff also changes splsched to be correct for all our architectures.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Nov 1 06:39:39 2004 UTC (19 years, 7 months ago) by marius
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.16: +5 -1 lines
Diff to previous 1.16 (colored)

additional DIAGNOSTIC, checking for proc in lockmgr when required

ok pedro@ tedu@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jun 13 21:49:26 2004 UTC (20 years ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.15: +890 -157 lines
Diff to previous 1.15 (colored)

debranch SMP, have fun

Revision 1.9.4.13 / (download) - annotate - [select for diffs], Sun Jun 13 08:14:06 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.9.4.12: +2 -2 lines
Diff to previous 1.9.4.12 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

Change an XXX comment to a true statement

Revision 1.9.4.12 / (download) - annotate - [select for diffs], Tue Jun 8 21:32:06 2004 UTC (20 years ago) by grange
Branch: SMP
Changes since 1.9.4.11: +5 -1 lines
Diff to previous 1.9.4.11 (colored) to branchpoint 1.9 (colored)

spinlock_release_all() and spinlock_acquire_count() are not ready yet,
disable it and save some space for install media.

ok niklas@ deraadt@

Revision 1.9.4.11 / (download) - annotate - [select for diffs], Sun Jun 6 23:11:51 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.9.4.10: +20 -12 lines
Diff to previous 1.9.4.10 (colored) to branchpoint 1.9 (colored)

stab at compiling in !MP for more archs

Revision 1.9.4.10 / (download) - annotate - [select for diffs], Sat Jun 5 23:18:25 2004 UTC (20 years ago) by tedu
Branch: SMP
Changes since 1.9.4.9: +2 -1 lines
Diff to previous 1.9.4.9 (colored) to branchpoint 1.9 (colored)

few fixes to make non-smp compile

Revision 1.9.4.9 / (download) - annotate - [select for diffs], Sat Jun 7 11:03:40 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.9.4.8: +2 -6 lines
Diff to previous 1.9.4.8 (colored) to branchpoint 1.9 (colored)

Sync SMP branch to -current

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jun 2 23:28:05 2003 UTC (21 years ago) by millert
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.14: +2 -6 lines
Diff to previous 1.14 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.9.4.8 / (download) - annotate - [select for diffs], Sun May 18 18:25:03 2003 UTC (21 years ago) by niklas
Branch: SMP
Changes since 1.9.4.7: +6 -1 lines
Diff to previous 1.9.4.7 (colored) to branchpoint 1.9 (colored)

do not create new commons

Revision 1.9.4.7 / (download) - annotate - [select for diffs], Sun May 18 17:41:16 2003 UTC (21 years ago) by niklas
Branch: SMP
Changes since 1.9.4.6: +62 -1 lines
Diff to previous 1.9.4.6 (colored) to branchpoint 1.9 (colored)

Go back to defining simplelocks as noops, even if MULTIPROCESSOR.  Instead use
a new real simple recursive-lock capable lock implementation for the few
necessary locks (kernel, scheduler, tlb shootdown, printf and ddb MP).
This because we cannot trust the old fine-grained locks spread out all over
our kernel, and not really tested.

Revision 1.9.4.6 / (download) - annotate - [select for diffs], Thu May 15 16:45:54 2003 UTC (21 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.9.4.5: +592 -143 lines
Diff to previous 1.9.4.5 (colored) to branchpoint 1.9 (colored)

merge netbsd lockmgr better, makes us halfway through rc

Revision 1.9.4.5 / (download) - annotate - [select for diffs], Thu May 15 04:08:02 2003 UTC (21 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.9.4.4: +233 -28 lines
Diff to previous 1.9.4.4 (colored) to branchpoint 1.9 (colored)

Biglock!  Most of the logic
comes from NetBSD.
Also a lot of fixes, enough to get a dual cpu machine actually run MP for a
very short while (we are just talking about seconds) before starving out one
of the cpus.  More coming very soon.

Revision 1.9.4.4 / (download) - annotate - [select for diffs], Fri Mar 28 00:41:26 2003 UTC (21 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.9.4.3: +2 -1 lines
Diff to previous 1.9.4.3 (colored) to branchpoint 1.9 (colored)

Sync the SMP branch with 3.3

Revision 1.11.2.2 / (download) - annotate - [select for diffs], Tue Oct 29 00:36:44 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.11.2.1: +3 -2 lines
Diff to previous 1.11.2.1 (colored) to branchpoint 1.11 (colored) next main 1.12 (colored)

sync to -current

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jul 12 14:03:12 2002 UTC (21 years, 11 months ago) by art
Branch: MAIN
CVS Tags: UBC_SYNC_B, UBC_SYNC_A, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

Detect the case where we LK_RELEASE a lock when noone is holding it.

Revision 1.11.2.1 / (download) - annotate - [select for diffs], Tue Jun 11 03:29:40 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.11: +10 -3 lines
Diff to previous 1.11 (colored)

Sync UBC branch to -current

Revision 1.9.4.3 / (download) - annotate - [select for diffs], Thu Mar 28 11:43:04 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.9.4.2: +9 -2 lines
Diff to previous 1.9.4.2 (colored) to branchpoint 1.9 (colored)

Merge in -current from about a week ago

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 17 18:26:51 2002 UTC (22 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.12: +8 -1 lines
Diff to previous 1.12 (colored)

Add a DIAGNOSTIC check for when both LK_CANRECURSE and
LK_RECURSEFAIL are set.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:04 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

First round of __P removal in sys

Revision 1.9.4.2 / (download) - annotate - [select for diffs], Wed Mar 6 02:13:23 2002 UTC (22 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.9.4.1: +1 -0 lines
Diff to previous 1.9.4.1 (colored) to branchpoint 1.9 (colored)

Merge in trunk

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 4 21:56:18 2001 UTC (22 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Add declaration of "state" to _simple_lock_assert().  Since it is
an int this can safely be omitted but it is bad style to do so.
Closes PR 2223.

Revision 1.9.4.1 / (download) - annotate - [select for diffs], Tue Nov 13 23:04:23 2001 UTC (22 years, 7 months ago) by niklas
Branch: SMP
Changes since 1.9: +7 -2 lines
Diff to previous 1.9 (colored)

merge in -current

Revision 1.10 / (download) - annotate - [select for diffs], Wed Nov 7 02:44:10 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.9: +7 -2 lines
Diff to previous 1.9 (colored)

new flag to lockmgr. LK_RECURSEFAIL - even if the lock can recurse fail.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jul 9 15:17:59 1999 UTC (24 years, 11 months ago) by art
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Branch point for: SMP
Changes since 1.8: +52 -21 lines
Diff to previous 1.8 (colored)

rename SIMPLELOCK_DEBUG to LOCKDEBUG
clean up the debug functions
add simple_lock_assert

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jan 11 05:12:22 1999 UTC (25 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

panic prints a newline for you, don't do it in the panic string

Revision 1.7 / (download) - annotate - [select for diffs], Mon Dec 28 19:13:04 1998 UTC (25 years, 5 months ago) by art
Branch: MAIN
Changes since 1.6: +11 -57 lines
Diff to previous 1.6 (colored)

simple debugging for simple locks

Revision 1.6 / (download) - annotate - [select for diffs], Tue Nov 10 22:20:36 1998 UTC (25 years, 7 months ago) by art
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

put text after endif into comments

Revision 1.5 / (download) - annotate - [select for diffs], Fri Nov 7 10:27:43 1997 UTC (26 years, 7 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.4: +2 -0 lines
Diff to previous 1.4 (colored)

$OpenBSD$

Revision 1.4 / (download) - annotate - [select for diffs], Thu Nov 6 22:41:06 1997 UTC (26 years, 7 months ago) by csapuntz
Branch: MAIN
Changes since 1.3: +13 -2 lines
Diff to previous 1.3 (colored)

Fixes so that it compiles with #ifdef DEBUG

Revision 1.3 / (download) - annotate - [select for diffs], Thu Nov 6 05:58:18 1997 UTC (26 years, 7 months ago) by csapuntz
Branch: MAIN
Changes since 1.2: +0 -0 lines
Diff to previous 1.2 (colored)

Updates for VFS Lite 2 + soft update.

Revision 1.2, Mon Oct 6 20:19:55 1997 UTC (26 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +0 -0 lines
FILE REMOVED

back out vfs lite2 till after 2.2

Revision 1.1 / (download) - annotate - [select for diffs], Mon Oct 6 15:12:21 1997 UTC (26 years, 8 months ago) by csapuntz
Branch: MAIN

VFS Lite2 Changes

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.