Solaris Dynamic Tracing Guide
Previous Next

Adaptive Lock Probes

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

adaptive-acquire

Hold-event probe that fires immediately after an adaptive lock is acquired.

adaptive-block

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, adaptive-block fires before adaptive-acquire. A single lock acquisition can fire both the adaptive-block and the adaptive-spin probes. arg1 for adaptive-block contains the sleep time in nanoseconds.

adaptive-spin

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, adaptive-spin fires before adaptive-acquire. A single lock acquisition can fire both the adaptive-block and the adaptive-spin probes. arg1 for adaptive-spin contains the spin time: the number of nanoseconds that were spent in the spin loop before the lock was acquired.

adaptive-release

Hold-event probe that fires immediately after an adaptive lock is released.

Previous Next