Method and system for low overhead spin lock instrumentation
Abstract
A method and apparatus is presented for controlling spin lock instrumentation for a spin lock in a system with a cache. A lock flag represents a busy state for the spin lock; a first instrumentation flag is a global variable representing an enablement state for the spin lock instrumentation. A second instrumentation flag, stored within the same cache line as the lock flag, is also maintained as an updateable indication of the first instrumentation flag. Prior to each acquirement of the spin lock, the second instrumentation flag is checked for an indication that spin lock instrumentation is enabled. Although a reading of the lock flag may generate a cache miss, the lock flag is necessarily checked upon attempting to acquire the lock; the check of the second instrumentation flag cannot generate a superfluous cache miss because the second instrumentation flag is in the same cache line as the lock flag.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 5 · Forward citations: 23.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A method for controlling spin lock instrumentation for a spin lock in a data processing system comprising a cache consisting of cache lines, the method comprising: reserving a lock flag for the spin lock that represents a busy state for the spin lock; associating a first instrumentation flag with spin lock instrumentation that represents an enablement state for spin lock instrumentation; prior to each acquirement of the spin lock, determining whether or not a second instrumentation flag indicates that spin lock instrumentation is enabled, wherein the second instrumentation flag is an updateabl
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗