History log of /freebsd-9.3-release/share/man/man9/sx.9
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 193011 28-May-2009 attilio

Reverse the logic for ADAPTIVE_SX option and enable it by default.
Introduce for this operation the reverse NO_ADAPTIVE_SX option.
The flag SX_ADAPTIVESPIN to be passed to sx_init_flags(9) gets suppressed
and the new flag, offering the reversed logic, SX_NOADAPTIVE is added.

Additively implements adaptive spininning for sx held in shared mode.
The spinning limit can be handled through sysctls in order to be tuned
while the code doesn't reach the release, after which time they should
be dropped probabilly.

This change has made been necessary by recent benchmarks where it does
improve concurrency of workloads in presence of high contention
(ie. ZFS).

KPI breakage is documented by __FreeBSD_version bumping, manpage and
UPDATING updates.

Requested by: jeff, kmacy
Reviewed by: jeff
Tested by: pho


# 173940 26-Nov-2007 brueffer

Bump .Dd for previous revision.


# 173888 24-Nov-2007 attilio

Update sx(9) lock manpage in order to add missing prototypes for function
sx_slock_sig() and sx_xlock_sig() and their respective explanation.


# 169780 19-May-2007 jhb

Rename the macros for assertion flags passed to sx_assert() from SX_* to
SA_* to match mutexes and rwlocks. The old flags still exist for
backwards compatiblity.

Requested by: attilio


# 169777 19-May-2007 jhb

Document sx_xholder().


# 169770 19-May-2007 jhb

Document SX_RECURSE flag.


# 168191 31-Mar-2007 jhb

Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks. The algorithms for
manipulating the lock cookie are very similar to that rwlocks. This patch
also adds support for exclusive locks using the same algorithm as mutexes.

A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior. The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.

Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.

The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels. As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.

The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.

The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.

MFC after: 1 month
Submitted by: attilio
Tested by: kris, pjd


# 168071 30-Mar-2007 julian

Add some cross references to locking.9 from related pages.


# 167387 09-Mar-2007 jhb

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.


# 167371 09-Mar-2007 jhb

- Sort functions in the order that rwlock(9) and mutex(9) use.
- Markup sx_unlock() as a function rather than saying it is a macro.
The macro part is an implementation detail, and all the other sx_*lock()
functions are actually macros, too.
- Use the same style as rwlock(9) and mutex(9) to markup sx_assert() and
SX_SYSINIT() with respect to headers and kernel options.
- Add a missing MLINK.


# 160300 12-Jul-2006 pjd

Document sx_xlocked(9).

Submitted by: ssouhlal


# 157880 19-Apr-2006 jhb

Trim a couple of xrefs.


# 155193 01-Feb-2006 glebius

Xref rwlock(9).

Reviewed by: ru


# 140140 12-Jan-2005 ru

Scheduled mdoc(7) sweep.


# 139736 05-Jan-2005 keramida

Make an attempt at explaining why sx(9) locks cannot be safely obtained
after acquiring a mutex(9).

PR: docs/75571
Submitted by: darrenr
Explanation by: jhb


# 131985 11-Jul-2004 darrenr

Document that sx_unlock() exists as a macro.
Remove redundant include file, <sys/kernel.h>, and clean up the function
list at the top with the addition of a "Sx utility macro" section.


# 130582 16-Jun-2004 ru

Assorted markup, spelling, and grammar fixes.


# 126202 24-Feb-2004 jhb

- Clarify ambiguous statement about not being able to both slock and xlock
a single lock at the same time.
- Avoid using "own" to refer to holding either a shared or exclusive lock
as it is only really correct for exclusive locks.
- Reword the sentence about sleep-ability to read easier.

Requested by: truckman (1)


# 125422 04-Feb-2004 pjd

Document new 'what' value for sx_assert(9).

PS. There is a inconsistency in this manual page, because in
non-WITNESS case sx_assert(9) does not panics, it only prints
the warning. I haven't fixed this, because jhb@ is planing to
replace those printf()s with panic()s.

Reviewed by: jhb
Approved by: jhb, scottl (mentor)


# 124037 01-Jan-2004 jkoshy

Add "options INVARIANTS" and "options INVARIANT_SUPPORT" to the
synopsis, with supporting text in the body of the manual page.

Add a cross-reference to panic(9) for completeness.

Reviewed by: ru (synopsis changes)


# 123918 27-Dec-2003 jkoshy

Make this manual page reflect the sources better.

- A #include of <sys/mutex.h> is no longer needed to use sx(9) (since
2001/05/01).
- Use of the SX_SYSINIT() macro requires inclusion of '<sys/kernel.h>'


# 123891 27-Dec-2003 jkoshy

Improve continuity of text.


# 120054 14-Sep-2003 ru

Get rid of duplicates.


# 116255 12-Jun-2003 harti

Document the fact that one is allowed to sleep while holding an sx lock.

Discussed with: jhb@


# 97493 29-May-2002 ru

mdoc(7) police: lint.


# 94964 17-Apr-2002 fenner

mdoc police: turn .PP back into .Pp


# 94474 12-Apr-2002 davidc

Update the .Fn line for SX_SYSINIT to include the parameter types.


# 93680 02-Apr-2002 arr

- Add notes about SX_SYSINIT and MTX_SYSINIT in order to document the
recent additions of these macros.
- Add in a MLINK to create SX_SYSINIT.9 and MTX_SYSINIT.9.


# 93337 28-Mar-2002 dd

Add mtx_pool(9) to the SEE ALSO section.

Submitted by: Garrett Rooney <rooneg@electricjellyfish.net>


# 86723 21-Nov-2001 ru

mdoc(7) police: WITNESS is a #define, mark it as such.


# 86722 21-Nov-2001 ru

mdoc(7) police: cosmetique.


# 85392 23-Oct-2001 jhb

Document sx_assert(9).


# 84453 04-Oct-2001 bde

Fixed wrong include in synopsis.


# 84306 01-Oct-2001 ru

mdoc(7) police: Use the new .In macro for #include statements.


# 83567 17-Sep-2001 silby

Common Mike adds see alsos from all of the synchronization
man pages to their brethren.


# 81633 14-Aug-2001 ru

mdoc(7) police: bump document date.


# 81616 14-Aug-2001 jasone

Add missing commas.


# 81599 13-Aug-2001 jasone

Add sx_try_upgrade() and sx_downgrade().

Submitted by: Alexander Kabaev <ak03@gte.com>


# 81588 13-Aug-2001 ru

Spell "FreeBSD" with "F" and "BSD" in uppercase.


# 81223 07-Aug-2001 jasone

Document sx_try_[sx]lock().


# 79727 14-Jul-2001 schweikh

Removed whitespace at end-of-line; no content changes. I simply did
cd src/share; find man[1-9] -type f|xargs perl -pi -e 's/[ \t]+$//'

BTW, what editors are the culprits? I'm using vim and it shows
me whitespace at EOL in troff files with a thick blue block...

Reviewed by: Silence from cvs diff -b
MFC after: 7 days


# 75172 04-Apr-2001 ru

mdoc(7) police: removed final dot from the .Nd call.


# 74932 28-Mar-2001 jhb

- Both <sys/sx.h> and <sys/mutex.h> depend on <sys/types.h> and
<sys/lock.h>.
- <sys/sx.h> depends on <sys/mutex.h>.


# 73782 05-Mar-2001 jasone

Implement shared/exclusive locks.

Reviewed by: bmilekic, jake, jhb