Commit Graph

35 Commits

Author SHA1 Message Date
attilio
256667d4fb Introduce support for adaptive spinning in lockmgr.
Actually, as it did receive few tuning, the support is disabled by
default, but it can opt-in with the option ADAPTIVE_LOCKMGRS.
Due to the nature of lockmgrs, adaptive spinning needs to be
selectively enabled for any interested lockmgr.
The support is bi-directional, or, in other ways, it will work in both
cases if the lock is held in read or write way.  In particular, the
read path is passible of further tunning using the sysctls
debug.lockmgr.retries and debug.lockmgr.loops .  Ideally, such sysctls
should be axed or compiled out before release.

Addictionally note that adaptive spinning doesn't cope well with
LK_SLEEPFAIL.  The reason is that many (and probabilly all) consumers
of LK_SLEEPFAIL are mainly interested in knowing if the interlock was
dropped or not in order to reacquire it and re-test initial conditions.
This directly interacts with adaptive spinning because lockmgr needs
to drop the interlock while spinning in order to avoid a deadlock
(further details in the comments inside the patch).

Final note: finding someone willing to help on tuning this with
relevant workloads would be either very important and appreciated.

Tested by:	jeff, pho
Requested by:	many
2009-06-17 01:55:42 +00:00
attilio
3a498bb803 Remove the assertive KA_HELD and KA_UNHELD as long as they are dangerous,
and not really helpful.
2009-02-05 15:09:04 +00:00
attilio
3827ab6b7e LK_NOWITNESS can be used now in lockmgr*() functions in order to skip
witness(4) checks on a per-instance basis.
2008-04-12 20:18:02 +00:00
attilio
da8539bd62 Commit manpages for lockmgr_args_rw(9) and lockmgr_rw(9). 2008-04-06 21:22:12 +00:00
brueffer
709a46133e Document lockmgr_waiters(9).
Reviewed by:	attilio
2008-03-28 21:30:37 +00:00
brueffer
43e8c2acbb New sentence -> new line. 2008-03-02 20:07:48 +00:00
attilio
342833e3ca Fix lockstatus sorting on the top list. 2008-03-01 21:24:07 +00:00
attilio
0d9e146f6b - Add the informations for lockmgr_args(9)
- Sort rightly lockstatus(9) in the manpage
2008-03-01 20:36:50 +00:00
attilio
037f2dd065 Update lockmgr manpage with last lockmgr modifies:
- Remove LK_SLEEPFAIL and LK_NOWAIT for lockinit() and add LK_QUIET and
  LK_NOPROFILE
- Include sys/lock.h as mandatory for the lockmgr support
2008-03-01 20:05:20 +00:00
attilio
98b1ca63ed Modify VOP_ISLOCKED() and lockstatus() prototypes in order to reflect
'thread' argument axing.
2008-02-25 19:12:01 +00:00
brueffer
ecd7efd241 Some language and mdoc style improvements. 2008-02-14 19:39:09 +00:00
attilio
588d2ab6cc Update manpage with lockmgr_assert() description. 2008-02-13 21:54:16 +00:00
attilio
2656e4d699 Update manpage in order to reflect LK_NODUP and LK_NOWITNESS options
introduction.
2008-02-06 00:50:51 +00:00
attilio
0db277677c Reflect lockcount() axing and lockmgr() prototype changing. 2008-01-24 14:17:52 +00:00
attilio
32e7c5ef2f Add the newly added function lockmgr_recursed() to the manpages. 2008-01-22 20:16:09 +00:00
brueffer
bf42a73d64 Fix typos. 2008-01-09 08:08:56 +00:00
attilio
bb203b2edf Add lockmgr_disown() and relative explanation. 2008-01-09 02:10:32 +00:00
attilio
c720b77ca9 Trimm out now unused option LK_EXCLUPGRADE from the lockmgr namespace.
This option just adds complexity and the new implementation no longer
will support it, so axing it now that it is unused is probabilly the
better idea.

FreeBSD version is bumped in order to reflect the KPI breakage introduced
by this patch.

In the ports tree, kris found that only old OSKit code uses it, but as
it is thought to work only on 2.x kernels serie, version bumping will
solve any problem.
2007-12-28 00:38:13 +00:00
brueffer
fca1690bb5 Remove duplicate xref and add missing commas.
PR:		113891
Submitted by:	pluknet <pluknet@gmail.com>
Approved by:	re (blanket)
2007-06-21 16:39:25 +00:00
julian
3f8481620d Add some cross references to locking.9 from related pages. 2007-03-30 18:07:26 +00:00
jhb
f5e3969340 Allow threads to atomically release rw and sx locks while waiting for an
event.  Locking primitives that support this (mtx, rw, and sx) now each
include their own foo_sleep() routine.
- Rename msleep() to _sleep() and change it's 'struct mtx' object to a
  'struct lock_object' pointer.  _sleep() uses the recently added
  lc_unlock() and lc_lock() function pointers for the lock class of the
  specified lock to release the lock while the thread is suspended.
- Add wrappers around _sleep() for mutexes (mtx_sleep()), rw locks
  (rw_sleep()), and sx locks (sx_sleep()).  msleep() still exists and
  is now identical to mtx_sleep(), but it is deprecated.
- Rename SLEEPQ_MSLEEP to SLEEPQ_SLEEP.
- Rewrite much of sleep.9 to not be msleep(9) centric.
- Flesh out the 'RETURN VALUES' section in sleep.9 and add an 'ERRORS'
  section.
- Add __nonnull(1) to _sleep() and msleep_spin() so that the compiler will
  warn if you try to pass a NULL wait channel.  The functions already have
  a KASSERT to that effect.
2007-03-09 22:41:01 +00:00
kib
4bb293498f Note that LK_UPGRADE may drop the shared lock before taking the
exclusive one.

Reviewed and edited by:	tegge
MFC after:	3 days
Approved by:	pjd (mentor)
2006-08-21 12:45:19 +00:00
maxim
2801f35e73 o Remove LK_REENABLE and LK_NOPAUSE lockinit(9) flags, add LK_NOSHARE.
MFC after:	1 week
2006-06-20 21:41:14 +00:00
hmp
6b954a1933 Use 'manual page' instead of 'man page' for consistency.
Approved by:	re (hrs)
2005-06-28 20:15:19 +00:00
ru
1c23ef339b mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
davidc
a783cc12f6 Update the prototype for lockinit to reflect that wmesg is a const char *. 2002-04-12 05:16:27 +00:00
davidc
92f87e9176 Fixed bad wording/spelling in few paragraphs. 2002-03-24 00:31:38 +00:00
davidc
988a2bb359 Merged all of the lockmgr functions into a single file (lock.9); as well,
some content and layout changes were made.

lock.9 had existed before but was never added to Makefile, so it was
never installed.  That is why the duplicate files were created in the
first place.

Reviewed by:	ru, alfred
2002-01-26 00:09:41 +00:00
ru
2fc48428c2 mdoc(7) police: tidy up the markup. 2002-01-10 12:32:38 +00:00
davidc
6b067561b6 Update function definitions and required include files to reflect
the current state of the system.

Approved by: alfred
2001-12-26 23:14:04 +00:00
ru
623da62a5a mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
ru
9001bc7070 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:31:11 +00:00
dd
eaa6ee03b8 mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
ru
eb4dd99698 mdoc(7) police: add the missing and required .Dd macro call. 2000-11-22 13:31:01 +00:00
markm
b1481ced76 Add some very crude man pages to try to induce folk to work on them.
Agreed to work on them:	jasone
2000-10-24 03:33:24 +00:00