Adaptive locks enforce mutual exclusion to a critical section, and may be acquired in most contexts in the kernel. Because adaptive locks have few context restrictions, they comprise the vast majority of synchronization primitives in the Solaris kernel. These locks are adaptive in their behavior with respect to contention: when a thread attempts to acquire a held adaptive lock, it will determine if the owning thread is currently running on a CPU. If the owner is running on another CPU, the acquiring thread will spin. If the owner is not running, the acquiring thread will block.
The four lockstat probes pertaining to adaptive locks are in Table 18–1. For each probe, arg0
contains a pointer to the kmutex_t
structure that represents the adaptive lock.
Table 18.1. Adaptive Lock Probes
|
Hold-event probe that fires immediately after an adaptive lock is acquired. |
|
Contention-event probe that fires after a thread that has blocked on a held adaptive mutex has reawakened and has acquired the mutex. If both probes are enabled, |
|
Contention-event probe that fires after a thread that has spun on a held adaptive mutex has successfully acquired the mutex. If both are enabled, |
|
Hold-event probe that fires immediately after an adaptive lock is released. |