Source string Read only

(itstool) path: question/para
Context English State
What is a <errorname>lock order reversal</errorname>?
The FreeBSD kernel uses a number of resource locks to arbitrate contention for certain resources. When multiple kernel threads try to obtain multiple resource locks, there's always the potential for a deadlock, where two threads have each obtained one of the locks and blocks forever waiting for the other thread to release one of the other locks. This sort of locking problem can be avoided if all threads obtain the locks in the same order.
A run-time lock diagnostic system called <citerefentry><refentrytitle>witness</refentrytitle><manvolnum>4</manvolnum></citerefentry>, enabled in FreeBSD-CURRENT and disabled by default for stable branches and releases, detects the potential for deadlocks due to locking errors, including errors caused by obtaining multiple resource locks with a different order from different parts of the kernel. The <citerefentry><refentrytitle>witness</refentrytitle><manvolnum>4</manvolnum></citerefentry> framework tries to detect this problem as it happens, and reports it by printing a message to the system console about a <errorname>lock order reversal</errorname> (often referred to also as <acronym>LOR</acronym>).
It is possible to get false positives, as <citerefentry><refentrytitle>witness</refentrytitle><manvolnum>4</manvolnum></citerefentry> is conservative. A true positive report <emphasis>does not</emphasis> mean that a system is dead-locked; instead it should be understood as a warning that a deadlock could have happened here.
Problematic <acronym>LOR</acronym>s tend to get fixed quickly, so check the <link xlink:href="">FreeBSD-CURRENT mailing list</link> before posting to it.
What does <errorname>Called ... with the following non-sleepable locks held</errorname> mean?
This means that a function that may sleep was called while a mutex (or other unsleepable) lock was held.
The reason this is an error is because mutexes are not intended to be held for long periods of time; they are supposed to only be held to maintain short periods of synchronization. This programming contract allows device drivers to use mutexes to synchronize with the rest of the kernel during interrupts. Interrupts (under FreeBSD) may not sleep. Hence it is imperative that no subsystem in the kernel block for an extended period while holding a mutex.
To catch such errors, assertions may be added to the kernel that interact with the <citerefentry><refentrytitle>witness</refentrytitle><manvolnum>4</manvolnum></citerefentry> subsystem to emit a warning or fatal error (depending on the system configuration) when a potentially blocking call is made while holding a mutex.
In summary, such warnings are non-fatal, however with unfortunate timing they could cause undesirable effects ranging from a minor blip in the system's responsiveness to a complete system lockup.
For additional information about locking in FreeBSD see <citerefentry><refentrytitle>locking</refentrytitle><manvolnum>9</manvolnum></citerefentry>.


No matching activity found.

Browse all component changes

Things to check


The string uses three dots (...) instead of an ellipsis character (…)



English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: question/para
No labels currently set.
Source string location
Source string age
9 months ago
Translation file
, string 355