# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR The FreeBSD Project # This file is distributed under the same license as the FreeBSD Documentation package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: FreeBSD Documentation VERSION\n" "POT-Creation-Date: 2022-02-01 10:28-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: Title = #: documentation/content/en/books/arch-handbook/locking/_index.adoc:1 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:13 #, no-wrap msgid "Locking Notes" msgstr "" #. type: YAML Front Matter: title #: documentation/content/en/books/arch-handbook/locking/_index.adoc:1 #, no-wrap msgid "Chapter 2. Locking Notes" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:51 msgid "" "_This chapter is maintained by the FreeBSD SMP Next Generation Project._" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:53 msgid "" "This document outlines the locking used in the FreeBSD kernel to permit " "effective multi-processing within the kernel. Locking can be achieved via " "several means. Data structures can be protected by mutexes or man:lockmgr[9] " "locks. A few variables are protected simply by always using atomic " "operations to access them." msgstr "" #. type: Title == #: documentation/content/en/books/arch-handbook/locking/_index.adoc:55 #, no-wrap msgid "Mutexes" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:58 msgid "" "A mutex is simply a lock used to guarantee mutual exclusion. Specifically, a " "mutex may only be owned by one entity at a time. If another entity wishes to " "obtain a mutex that is already owned, it must wait until the mutex is " "released. In the FreeBSD kernel, mutexes are owned by processes." msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:60 msgid "" "Mutexes may be recursively acquired, but they are intended to be held for a " "short period of time. Specifically, one may not sleep while holding a mutex. " "If you need to hold a lock across a sleep, use a man:lockmgr[9] lock." msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:62 msgid "Each mutex has several properties of interest:" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:63 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:91 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:130 #, no-wrap msgid "Variable Name" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:65 msgid "The name of the struct mtx variable in the kernel source." msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:66 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:92 #, no-wrap msgid "Logical Name" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:68 msgid "" "The name of the mutex assigned to it by `mtx_init`. This name is displayed " "in KTR trace messages and witness errors and warnings and is used to " "distinguish mutexes in the witness code." msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:69 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:93 #, no-wrap msgid "Type" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:71 msgid "" "The type of the mutex in terms of the `MTX_*` flags. The meaning for each " "flag is related to its meaning as documented in man:mutex[9]." msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:72 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:105 #, no-wrap msgid "`MTX_DEF`" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:74 msgid "A sleep mutex" msgstr "" #. type: Labeled list #: documentation/content/en/books/arch-handbook/locking/_index.adoc:75 #, no-wrap msgid "`MTX_SPIN`" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:77 msgid "A spin mutex" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:78 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:99 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:111 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:117 #, no-wrap msgid "`MTX_RECURSE`" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:80 msgid "This mutex is allowed to recurse." msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:81 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:94 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:132 #, no-wrap msgid "Protectees" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:83 msgid "" "A list of data structures or data structure members that this entry " "protects. For data structure members, the name will be in the form of " "`structure name`.`member name`." msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:84 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:96 #, no-wrap msgid "Dependent Functions" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:86 msgid "Functions that can only be called if this mutex is held." msgstr "" #. type: Block title #: documentation/content/en/books/arch-handbook/locking/_index.adoc:87 #, no-wrap msgid "Mutex List" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:97 #, no-wrap msgid "sched_lock" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:98 #, no-wrap msgid "\"sched lock\"" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:98 #: documentation/content/en/books/arch-handbook/locking/_index.adoc:116 #, no-wrap msgid "`MTX_SPIN` \\" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:100 #, no-wrap msgid "`_gmonparam`, `cnt.v_swtch`, `cp_time`, `curpriority`, `mtx`.`mtx_blocked`, `mtx`.`mtx_contested`, `proc`.`p_procq`, `proc`.`p_slpq`, `proc`.`p_sflag`, `proc`.`p_stat`, `proc`.`p_estcpu`, `proc`.`p_cpticks` `proc`.`p_pctcpu`, `proc`.`p_wchan`, `proc`.`p_wmesg`, `proc`.`p_swtime`, `proc`.`p_slptime`, `proc`.`p_runtime`, `proc`.`p_uu`, `proc`.`p_su`, `proc`.`p_iu`, `proc`.`p_uticks`, `proc`.`p_sticks`, `proc`.`p_iticks`, `proc`.`p_oncpu`, `proc`.`p_lastcpu`, `proc`.`p_rqindex`, `proc`.`p_heldmtx`, `proc`.`p_blocked`, `proc`.`p_mtxname`, `proc`.`p_contested`, `proc`.`p_priority`, `proc`.`p_usrpri`, `proc`.`p_nativepri`, `proc`.`p_nice`, `proc`.`p_rtprio`, `pscnt`, `slpque`, `itqueuebits`, `itqueues`, `rtqueuebits`, `rtqueues`, `queuebits`, `queues`, `idqueuebits`, `idqueues`, `switchtime`, `switchticks`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:102 #, no-wrap msgid "`setrunqueue`, `remrunqueue`, `mi_switch`, `chooseproc`, `schedclock`, `resetpriority`, `updatepri`, `maybe_resched`, `cpu_switch`, `cpu_throw`, `need_resched`, `resched_wanted`, `clear_resched`, `aston`, `astoff`, `astpending`, `calcru`, `proc_compare`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:103 #, no-wrap msgid "vm86pcb_lock" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:104 #, no-wrap msgid "\"vm86pcb lock\"" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:106 #, no-wrap msgid "`vm86pcb`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:108 #, no-wrap msgid "`vm86_bioscall`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:109 #, no-wrap msgid "Giant" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:110 #, no-wrap msgid "\"Giant\"" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:110 #, no-wrap msgid "`MTX_DEF` \\" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:112 #, no-wrap msgid "nearly everything" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:114 #, no-wrap msgid "lots" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:115 #, no-wrap msgid "callout_lock" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:116 #, no-wrap msgid "\"callout lock\"" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:118 #, no-wrap msgid "`callfree`, `callwheel`, `nextsoftcheck`, `proc`.`p_itcallout`, `proc`.`p_slpcallout`, `softticks`, `ticks`" msgstr "" #. type: Title == #: documentation/content/en/books/arch-handbook/locking/_index.adoc:122 #, no-wrap msgid "Shared Exclusive Locks" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:125 msgid "" "These locks provide basic reader-writer type functionality and may be held " "by a sleeping process. Currently they are backed by man:lockmgr[9]." msgstr "" #. type: Block title #: documentation/content/en/books/arch-handbook/locking/_index.adoc:126 #, no-wrap msgid "Shared Exclusive Lock List" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:133 #, no-wrap msgid "`allproc_lock`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:135 #, no-wrap msgid "`allproc` `zombproc` `pidhashtbl` `proc`.`p_list` `proc`.`p_hash` `nextpid`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:136 #, no-wrap msgid "`proctree_lock`" msgstr "" #. type: Table #: documentation/content/en/books/arch-handbook/locking/_index.adoc:137 #, no-wrap msgid "`proc`.`p_children` `proc`.`p_sibling`" msgstr "" #. type: Title == #: documentation/content/en/books/arch-handbook/locking/_index.adoc:140 #, no-wrap msgid "Atomically Protected Variables" msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:143 msgid "" "An atomically protected variable is a special variable that is not protected " "by an explicit lock. Instead, all data accesses to the variables use special " "atomic operations as described in man:atomic[9]. Very few variables are " "treated this way, although other synchronization primitives such as mutexes " "are implemented with atomically protected variables." msgstr "" #. type: Plain text #: documentation/content/en/books/arch-handbook/locking/_index.adoc:144 msgid "`mtx`.`mtx_lock`" msgstr ""