Apparatus, method and computer program product for converting simple locks in a multiprocessor system
First Claim
1. A method of locking a system resource in a multiprocessor system, comprising:
- attempting to obtain a lock on the system resource;
associating a hand-off lock with the lock on the system resource if the attempt to obtain the lock is unsuccessful, wherein the hand-off lock includes a plurality of pre-processor spin fields, each pre-processor spin field being associated with one processor in the multiprocessor system and identifying a memory location dedicated to that one processor, and wherein only the one processor may spin on the memory location identified by the processor'"'"'s corresponding dedicated per-processor spin field at any one time; and
obtaining the hand-off lock on the system resource if the attempt to obtain the lock on the system resource is unsuccessful, wherein obtaining the hand-off lock includes spinning on the memory location identified by the per-processor spin field for an associated processor.
1 Assignment
0 Petitions
Accused Products
Abstract
An apparatus, method and computer program product for minimizing the negative effects that occur when simple locks are highly contended among processors which may or may not have identical latencies to the memory that represents a given lock, are provided. The apparatus, method and computer program product minimize these effects by converting simple locks such that they act as standard simple locks when there is no contention and act as krlocks when there is contention for a lock. In this way, the number of processors spinning on a lock is limited to a single processor, thereby reducing the number of processors that are in a wait state and not performing any useful work.
-
Citations
48 Claims
-
1. A method of locking a system resource in a multiprocessor system, comprising:
-
attempting to obtain a lock on the system resource;
associating a hand-off lock with the lock on the system resource if the attempt to obtain the lock is unsuccessful, wherein the hand-off lock includes a plurality of pre-processor spin fields, each pre-processor spin field being associated with one processor in the multiprocessor system and identifying a memory location dedicated to that one processor, and wherein only the one processor may spin on the memory location identified by the processor'"'"'s corresponding dedicated per-processor spin field at any one time; and
obtaining the hand-off lock on the system resource if the attempt to obtain the lock on the system resource is unsuccessful, wherein obtaining the hand-off lock includes spinning on the memory location identified by the per-processor spin field for an associated processor. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 31, 32, 33, 34, 35, 36)
-
-
11. A computer program product in a computer readable medium for locking a system resource in a multiprocessor system, comprising:
-
first instructions for attempting to obtain a lock on the system resource;
second instructions for associating a hand-off lock with the lock on the system resource if the attempt to obtain the lock is unsuccessful, wherein the hand-off lock includes a plurality of per-processor spin fields, each per-processor spin field being associated with one processor in the multiprocessor system and identifying a memory location dedicated to that one processor, and wherein only the one processor may spin on the memory location identified by the processor'"'"'s corresponding dedicated per-processor spin field at any one time; and
third instructions for obtaining the hand-off lock on the system resource if the attempt to obtain the lock on the system resource is unsuccessful, wherein obtaining the hand-off lock includes spinning on the memory location identified by the per-processor spin field for an associated processor. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20, 37, 38, 39, 40, 41)
-
-
21. An apparatus for locking a system resource in a multiprocessor system, comprising:
-
means for attempting to obtain a lock on the system resource;
means for associating a hand-off lock with the lock on the system resource if the attempt to obtain the lock is unsuccessful, wherein the hand-off lock includes a plurality of per-processor spin fields, each per-processor spin field being associated with one processor in the multiprocessor system and identifying a memory location dedicated to that one processor, and wherein only the one processor may spin on the memory location identified by the processor'"'"'s corresponding dedicated per-processor spin field at any one time; and
means for obtaining the hand-off lock on the system resource if the attempt to obtain the lock on the system resource is unsuccessful, wherein obtaining the hand-off lock includes spinning on the memory location identified by the per-processor spin field for an associated processor. - View Dependent Claims (22, 23, 24, 25, 26, 27, 28, 29, 30, 42, 43, 44, 45, 46, 47, 48)
-
Specification