summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* KERNEL_ASSERT_LOCKED(9): Assertion for kernel lock (Rev. 3)uebayasi2014-07-131-1/+7
| | | | | | | | | | | | | | | 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@
* Teach rw_status() and rrw_status() to return LK_EXCLOTHER if it's writeguenther2014-07-091-1/+3
| | | | | | | locked by a different thread. Teach lockstatus() to return LK_EXCLUSIVE if an exclusive lock is held by some other thread. ok beck@ tedu@
* bzero -> memsettedu2014-01-211-2/+2
|
* restore original gangster lockstatus return values for compattedu2013-05-061-2/+10
|
* a few tweaks noticed by jsingtedu2013-05-011-2/+2
|
* exorcise lockmgr. the api remains, but is now backed by recursive rwlocks.tedu2013-05-011-281/+31
| | | | | originally by thib. ok deraadt jsing and anyone who tested
* do not include machine/cpu.h from a .c file; it is the responsibility ofderaadt2013-03-281-2/+1
| | | | | .h files to pull it in, if needed ok tedu
* lockmgr() wants to use a different address for the wchan when drainingguenther2011-08-281-7/+8
| | | | | | | | 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@
* Clean up after P_BIGLOCK removal.art2011-07-061-18/+1
| | | | | | | KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK oga@ ok
* Stop using the P_BIGLOCK flag to figure out when we should release theart2011-07-061-3/+1
| | | | | | | | | | | | 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
* cut down simple locks (so simple that they don't even lock) to the pointderaadt2010-04-261-415/+7
| | | | | | where there is almost nothing left to them, so that we can continue getting rid of them ok oga
* fix typos in comments, no code changes;schwarze2010-01-141-2/+2
| | | | | from Brad Tilley <brad at 16systems dot com>; ok oga@
* ntfs was the last user, LK_SLEEFAIL can die now.oga2009-03-251-5/+1
| | | | ok blambert@
* Surround WEHOLDIT() macro with braces to make it more safe.grange2009-01-151-2/+2
| | | | | | No binary change. ok otto@
* Remove some dead code that is confusing my greps.art2007-11-261-20/+1
|
* remove p_lock from struct proc; unused debug goo for lockmgr,thib2007-05-311-15/+1
| | | | | | wich gets set and never checked etc... ok art@,tedu@
* Don't use LK_CANRECURSE for the kernel lock, okay miod@ art@pedro2007-05-111-3/+2
|
* lockmgr_printinfo() is only called from #ifdef DIAGNOSTIC positions, so #ifdef DIAGNOSTIC it tooderaadt2007-05-081-1/+3
|
* Remove the lk_interlock from struct lock; Also remove the LK_INTERLOCKthib2007-04-121-23/+3
| | | | | | flag. This effectively makes the simplelock argument to lockmgr() fluff. ok miod@
* lockmgr keeps losing code, call 911!miod2007-04-111-66/+8
| | | | ok pedro@ art@
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-3/+3
| | | | | | | | | | | | 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
* Consistently spell FALLTHROUGH to appease lint.jsg2007-02-141-3/+3
| | | | ok kettenis@ cloder@ tom@ henning@
* Remove unused functionality from lockmgr():miod2007-02-031-385/+46
| | | | | | | | | | | - 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
* remove duplicate comment;jmc2006-01-031-6/+1
| | | | from thordur i. bjornsson;
* ansi/deregister.jsg2005-11-281-29/+9
| | | | 'go for it' deraadt@
* Remove unnecessary lockmgr() archaism that was costing too much in termspedro2005-11-191-3/+3
| | | | | | 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.
* sched work by niklas and art backed out; causes panicsderaadt2005-05-291-1/+69
|
* This patch is mortly art's work and was done *a year* ago. Art wants to thankniklas2005-05-251-69/+1
| | | | | | | | | | | | | | | | 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.
* additional DIAGNOSTIC, checking for proc in lockmgr when requiredmarius2004-11-011-1/+5
| | | | ok pedro@ tedu@
* debranch SMP, have funniklas2004-06-131-157/+890
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Detect the case where we LK_RELEASE a lock when noone is holding it.art2002-07-121-2/+3
|
* Add a DIAGNOSTIC check for when both LK_CANRECURSE andart2002-03-171-1/+8
| | | | LK_RECURSEFAIL are set.
* First round of __P removal in sysmillert2002-03-141-3/+3
|
* Add declaration of "state" to _simple_lock_assert(). Since it ismillert2001-12-041-1/+2
| | | | | an int this can safely be omitted but it is bad style to do so. Closes PR 2223.
* new flag to lockmgr. LK_RECURSEFAIL - even if the lock can recurse fail.art2001-11-071-2/+7
|
* rename SIMPLELOCK_DEBUG to LOCKDEBUGart1999-07-091-21/+52
| | | | | clean up the debug functions add simple_lock_assert
* panic prints a newline for you, don't do it in the panic stringmillert1999-01-111-2/+2
|
* simple debugging for simple locksart1998-12-281-57/+11
|
* put text after endif into commentsart1998-11-101-2/+2
|
* $OpenBSD$niklas1997-11-071-0/+2
|
* Fixes so that it compiles with #ifdef DEBUGcsapuntz1997-11-061-2/+13
|
* Updates for VFS Lite 2 + soft update.csapuntz1997-11-061-0/+537
|
* back out vfs lite2 till after 2.2deraadt1997-10-061-537/+0
|
* VFS Lite2 Changescsapuntz1997-10-061-0/+537