Check in some updates I made to this ages ago which are at least still

partially applicable.  This does at least remove some mutex flags that
were obsoleted a long, long time ago as well as rename the lockmgr section
to be more generic.
This commit is contained in:
John Baldwin 2003-02-03 18:47:06 +00:00
parent acf941b608
commit 6fa60155c8
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=15894
2 changed files with 92 additions and 132 deletions
en_US.ISO8859-1/books
arch-handbook/locking
developers-handbook/locking

View file

@ -79,28 +79,9 @@
</varlistentry>
<varlistentry>
<term><constant>MTX_COLD</constant></term>
<term><constant>MTX_RECURSE</constant></term>
<listitem>
<para>This mutex is initialized very early. Thus, it
must be declared via
<function>MUTEX_DECLARE</function>, and the
<constant>MTX_COLD</constant> flag must be passed to
<function>mtx_init</function>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>MTX_TOPHALF</constant></term>
<listitem>
<para>This spin mutex does not disable
interrupts.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>MTX_NORECURSE</constant></term>
<listitem>
<para>This mutex is not allowed to recurse.</para>
<para>This mutex is allowed to recurse.</para>
</listitem>
</varlistentry>
</variablelist>
@ -147,7 +128,7 @@
<entry><quote>sched lock</quote></entry>
<entry>
<constant>MTX_SPIN</constant> |
<constant>MTX_COLD</constant>
<constant>MTX_RECURSE</constant>
</entry>
<entry>
<varname>_gmonparam</varname>,
@ -156,42 +137,36 @@
<varname>curpriority</varname>,
<structname/mtx/.<structfield/mtx_blocked/,
<structname/mtx/.<structfield/mtx_contested/,
<structname/proc/.<structfield/p_contested/,
<structname/proc/.<structfield/p_blocked/,
<structname/proc/.<structfield/p_flag/
(<constant>P_PROFIL</constant> XXX,
<constant>P_INMEM</constant>,
<constant>P_SINTR</constant>,
<constant>P_TIMEOUT</constant>,
<constant>P_SWAPINREQ</constant> XXX,
<constant>P_INMEN</constant> XXX),
<structname/proc/.<structfield/p_nice/,
<structname/proc/.<structfield/p_procq/,
<structname/proc/.<structfield/p_blocked/,
<structname/proc/.<structfield/p_estcpu/,
<structname/proc/.<structfield/p_nativepri/,
<structname/proc/.<structfield/p_priority/,
<structname/proc/.<structfield/p_usrpri/,
<structname/proc/.<structfield/p_rtprio/,
<structname/proc/.<structfield/p_rqindex/,
<structname/proc/.<structfield/p_stats->p_prof/,
<structname/proc/.<structfield/p_stats->p_ru/,
<structname/proc/.<structfield/p_slpq/,
<structname/proc/.<structfield/p_sflag/
<structname/proc/.<structfield/p_stat/,
<structname/proc/.<structfield/p_estcpu/,
<structname/proc/.<structfield/p_cpticks/
<structname/proc/.<structfield/p_iticks/,
<structname/proc/.<structfield/p_uticks/,
<structname/proc/.<structfield/p_sticks/,
<structname/proc/.<structfield/p_pctcpu/,
<structname/proc/.<structfield/p_wchan/,
<structname/proc/.<structfield/p_wmesg/,
<structname/proc/.<structfield/p_swtime/,
<structname/proc/.<structfield/p_slptime/,
<structname/proc/.<structfield/p_runtime/,
<structname/proc/.<structfield/p_pctcpu/,
<structname/proc/.<structfield/p_uu/,
<structname/proc/.<structfield/p_su/,
<structname/proc/.<structfield/p_iu/,
<structname/proc/.<structfield/p_uticks/,
<structname/proc/.<structfield/p_sticks/,
<structname/proc/.<structfield/p_iticks/,
<structname/proc/.<structfield/p_oncpu/,
<structname/proc/.<structfield/p_asleep/,
<structname/proc/.<structfield/p_wchan/,
<structname/proc/.<structfield/p_wmesg/,
<structname/proc/.<structfield/p_slpq/,
<structname/proc/.<structfield/p_vmspace/
(XXX - in <function>statclock</function>),
<structname/proc/.<structfield/p_lastcpu/,
<structname/proc/.<structfield/p_rqindex/,
<structname/proc/.<structfield/p_heldmtx/,
<structname/proc/.<structfield/p_blocked/,
<structname/proc/.<structfield/p_mtxname/,
<structname/proc/.<structfield/p_contested/,
<structname/proc/.<structfield/p_priority/,
<structname/proc/.<structfield/p_usrpri/,
<structname/proc/.<structfield/p_nativepri/,
<structname/proc/.<structfield/p_nice/,
<structname/proc/.<structfield/p_rtprio/,
<varname>pscnt</varname>,
<varname>slpque</varname>,
<varname>itqueuebits</varname>,
@ -203,6 +178,7 @@
<varname>idqueuebits</varname>,
<varname>idqueues</varname>,
<varname>switchtime</varname>,
<varname>switchticks</varname>
</entry>
<entry>
<function>setrunqueue</function>,
@ -214,7 +190,15 @@
<function>updatepri</function>,
<function>maybe_resched</function>,
<function>cpu_switch</function>,
<function>cpu_throw</function>
<function>cpu_throw</function>,
<function>need_resched</function>,
<function>resched_wanted</function>,
<function>clear_resched</function>,
<function>aston</function>,
<function>astoff</function>,
<function>astpending</function>,
<function>calcru</function>,
<function>proc_compare</function>
</entry>
</row>
@ -223,8 +207,7 @@
<entry>vm86pcb_lock</entry>
<entry><quote>vm86pcb lock</quote></entry>
<entry>
<constant>MTX_DEF</constant> |
<constant>MTX_COLD</constant>
<constant>MTX_DEF</constant>
</entry>
<entry>
<varname>vm86pcb</varname>
@ -240,7 +223,7 @@
<entry><quote>Giant</quote></entry>
<entry>
<constant>MTX_DEF</constant> |
<constant>MTX_COLD</constant>
<constant>MTX_RECURSE</constant>
</entry>
<entry>nearly everything</entry>
<entry>lots</entry>
@ -251,7 +234,8 @@
<entry>callout_lock</entry>
<entry><quote>callout lock</quote></entry>
<entry>
<constant>MTX_SPIN</constant>
<constant>MTX_SPIN</constant> |
<constant>MTX_RECURSE</constant>
</entry>
<entry>
<varname>callfree</varname>,
@ -270,15 +254,15 @@
</table>
</sect1>
<sect1 id="locking-lockmgr">
<title>Lock Manager Locks</title>
<sect1 id="locking-sx">
<title>Shared Exclusive Locks</title>
<para>Locks that are provided via the &man.lockmgr.9; interface
are lock manager locks. These locks are reader-writer locks and
may be held by a sleeping process.</para>
<para>These locks provide basic reader-writer type functionality
and may be held by a sleeping process. Currently they are
backed by &man.lockmgr.9;.</para>
<table>
<title>&man.lockmgr.9; Lock List</title>
<title>Shared Exclusive Lock List</title>
<tgroup cols="2">
<thead>
@ -321,10 +305,6 @@
variables.</para>
<itemizedlist>
<listitem>
<para><varname>astpending</varname></para>
</listitem>
<listitem>
<para><structname/mtx/.<structfield/mtx_lock/</para>
</listitem>

View file

@ -79,28 +79,9 @@
</varlistentry>
<varlistentry>
<term><constant>MTX_COLD</constant></term>
<term><constant>MTX_RECURSE</constant></term>
<listitem>
<para>This mutex is initialized very early. Thus, it
must be declared via
<function>MUTEX_DECLARE</function>, and the
<constant>MTX_COLD</constant> flag must be passed to
<function>mtx_init</function>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>MTX_TOPHALF</constant></term>
<listitem>
<para>This spin mutex does not disable
interrupts.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>MTX_NORECURSE</constant></term>
<listitem>
<para>This mutex is not allowed to recurse.</para>
<para>This mutex is allowed to recurse.</para>
</listitem>
</varlistentry>
</variablelist>
@ -147,7 +128,7 @@
<entry><quote>sched lock</quote></entry>
<entry>
<constant>MTX_SPIN</constant> |
<constant>MTX_COLD</constant>
<constant>MTX_RECURSE</constant>
</entry>
<entry>
<varname>_gmonparam</varname>,
@ -156,42 +137,36 @@
<varname>curpriority</varname>,
<structname/mtx/.<structfield/mtx_blocked/,
<structname/mtx/.<structfield/mtx_contested/,
<structname/proc/.<structfield/p_contested/,
<structname/proc/.<structfield/p_blocked/,
<structname/proc/.<structfield/p_flag/
(<constant>P_PROFIL</constant> XXX,
<constant>P_INMEM</constant>,
<constant>P_SINTR</constant>,
<constant>P_TIMEOUT</constant>,
<constant>P_SWAPINREQ</constant> XXX,
<constant>P_INMEN</constant> XXX),
<structname/proc/.<structfield/p_nice/,
<structname/proc/.<structfield/p_procq/,
<structname/proc/.<structfield/p_blocked/,
<structname/proc/.<structfield/p_estcpu/,
<structname/proc/.<structfield/p_nativepri/,
<structname/proc/.<structfield/p_priority/,
<structname/proc/.<structfield/p_usrpri/,
<structname/proc/.<structfield/p_rtprio/,
<structname/proc/.<structfield/p_rqindex/,
<structname/proc/.<structfield/p_stats->p_prof/,
<structname/proc/.<structfield/p_stats->p_ru/,
<structname/proc/.<structfield/p_slpq/,
<structname/proc/.<structfield/p_sflag/
<structname/proc/.<structfield/p_stat/,
<structname/proc/.<structfield/p_estcpu/,
<structname/proc/.<structfield/p_cpticks/
<structname/proc/.<structfield/p_iticks/,
<structname/proc/.<structfield/p_uticks/,
<structname/proc/.<structfield/p_sticks/,
<structname/proc/.<structfield/p_pctcpu/,
<structname/proc/.<structfield/p_wchan/,
<structname/proc/.<structfield/p_wmesg/,
<structname/proc/.<structfield/p_swtime/,
<structname/proc/.<structfield/p_slptime/,
<structname/proc/.<structfield/p_runtime/,
<structname/proc/.<structfield/p_pctcpu/,
<structname/proc/.<structfield/p_uu/,
<structname/proc/.<structfield/p_su/,
<structname/proc/.<structfield/p_iu/,
<structname/proc/.<structfield/p_uticks/,
<structname/proc/.<structfield/p_sticks/,
<structname/proc/.<structfield/p_iticks/,
<structname/proc/.<structfield/p_oncpu/,
<structname/proc/.<structfield/p_asleep/,
<structname/proc/.<structfield/p_wchan/,
<structname/proc/.<structfield/p_wmesg/,
<structname/proc/.<structfield/p_slpq/,
<structname/proc/.<structfield/p_vmspace/
(XXX - in <function>statclock</function>),
<structname/proc/.<structfield/p_lastcpu/,
<structname/proc/.<structfield/p_rqindex/,
<structname/proc/.<structfield/p_heldmtx/,
<structname/proc/.<structfield/p_blocked/,
<structname/proc/.<structfield/p_mtxname/,
<structname/proc/.<structfield/p_contested/,
<structname/proc/.<structfield/p_priority/,
<structname/proc/.<structfield/p_usrpri/,
<structname/proc/.<structfield/p_nativepri/,
<structname/proc/.<structfield/p_nice/,
<structname/proc/.<structfield/p_rtprio/,
<varname>pscnt</varname>,
<varname>slpque</varname>,
<varname>itqueuebits</varname>,
@ -203,6 +178,7 @@
<varname>idqueuebits</varname>,
<varname>idqueues</varname>,
<varname>switchtime</varname>,
<varname>switchticks</varname>
</entry>
<entry>
<function>setrunqueue</function>,
@ -214,7 +190,15 @@
<function>updatepri</function>,
<function>maybe_resched</function>,
<function>cpu_switch</function>,
<function>cpu_throw</function>
<function>cpu_throw</function>,
<function>need_resched</function>,
<function>resched_wanted</function>,
<function>clear_resched</function>,
<function>aston</function>,
<function>astoff</function>,
<function>astpending</function>,
<function>calcru</function>,
<function>proc_compare</function>
</entry>
</row>
@ -223,8 +207,7 @@
<entry>vm86pcb_lock</entry>
<entry><quote>vm86pcb lock</quote></entry>
<entry>
<constant>MTX_DEF</constant> |
<constant>MTX_COLD</constant>
<constant>MTX_DEF</constant>
</entry>
<entry>
<varname>vm86pcb</varname>
@ -240,7 +223,7 @@
<entry><quote>Giant</quote></entry>
<entry>
<constant>MTX_DEF</constant> |
<constant>MTX_COLD</constant>
<constant>MTX_RECURSE</constant>
</entry>
<entry>nearly everything</entry>
<entry>lots</entry>
@ -251,7 +234,8 @@
<entry>callout_lock</entry>
<entry><quote>callout lock</quote></entry>
<entry>
<constant>MTX_SPIN</constant>
<constant>MTX_SPIN</constant> |
<constant>MTX_RECURSE</constant>
</entry>
<entry>
<varname>callfree</varname>,
@ -270,15 +254,15 @@
</table>
</sect1>
<sect1 id="locking-lockmgr">
<title>Lock Manager Locks</title>
<sect1 id="locking-sx">
<title>Shared Exclusive Locks</title>
<para>Locks that are provided via the &man.lockmgr.9; interface
are lock manager locks. These locks are reader-writer locks and
may be held by a sleeping process.</para>
<para>These locks provide basic reader-writer type functionality
and may be held by a sleeping process. Currently they are
backed by &man.lockmgr.9;.</para>
<table>
<title>&man.lockmgr.9; Lock List</title>
<title>Shared Exclusive Lock List</title>
<tgroup cols="2">
<thead>
@ -321,10 +305,6 @@
variables.</para>
<itemizedlist>
<listitem>
<para><varname>astpending</varname></para>
</listitem>
<listitem>
<para><structname/mtx/.<structfield/mtx_lock/</para>
</listitem>