Scalable spinlocks for non-uniform memory access
First Claim
1. A computer system comprising:
- a plurality of sockets, each socket of the plurality of sockets comprising at least one central processing unit (CPU) and locally attached memory, wherein each CPU in each socket is communicatively coupled to the locally attached memory of the socket;
a global spinlock configured to control access to a shareable resource, the global spinlock comprising a first flag and a second flag; and
a plurality of local spinlocks, each local spinlock of the plurality of local spinlocks configured to control access to the global spinlock;
wherein the first flag indicates whether the global spinlock is directly acquired, and the second flag indicates whether the global spinlock is acquired through a local spinlock configured to control access to the global spinlock.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques are disclosed to provide scalable spinlocks for non-uniform memory access (NUMA). In some examples, a global spinlock configured to protect access to a shareable resource is protected by multiple local spinlocks, which are each configured to control access to the global spinlock. In a multi-socket NUMA system, the global spinlock is allocated on one of the sockets, and the local spinlocks are distributed over the multiple sockets. In some embodiments, one local spinlock is allocated on each of the multiple sockets. In other embodiments, the multiple local spinlocks may be equally distributed over the NUMA sockets. When contention for the global spinlock is low, processes can attempt to directly acquire the global spinlock. In contrast, when contention for the global spinlock is high, processes need to first acquire one of the local spinlocks associated with the global spinlock before attempting to acquire the global spinlock.
8 Citations
25 Claims
-
1. A computer system comprising:
-
a plurality of sockets, each socket of the plurality of sockets comprising at least one central processing unit (CPU) and locally attached memory, wherein each CPU in each socket is communicatively coupled to the locally attached memory of the socket; a global spinlock configured to control access to a shareable resource, the global spinlock comprising a first flag and a second flag; and a plurality of local spinlocks, each local spinlock of the plurality of local spinlocks configured to control access to the global spinlock; wherein the first flag indicates whether the global spinlock is directly acquired, and the second flag indicates whether the global spinlock is acquired through a local spinlock configured to control access to the global spinlock. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer-implemented method to control access to a shareable resource, the method comprising:
-
allocating a global spinlock configured to control access to a shareable resource, the global spinlock comprising a first flag and a second flag; and allocating a plurality of local spinlocks, each local spinlock of the plurality of local spinlocks configured to control access to the global spinlock; wherein the first flag indicates whether the global spinlock is directly acquired, and the second flag indicates whether the global spinlock is acquired through a local spinlock configured to control access to the global spinlock. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
-
-
21. A computer program product including one or more non-transitory machine readable mediums encoded with instructions that when executed by one or more processors cause a process to be carried out to control access to a shareable resource, the process comprising:
-
allocating a global spinlock configured to control access to a shareable resource, the global spinlock comprising a first flag and a second flag; and allocating a plurality of local spinlocks, each local spinlock of the plurality of local spinlocks configured to control access to the global spinlock; wherein the first flag indicates whether the global spinlock is directly acquired, and the second flag indicates whether the global spinlock is acquired through a local spinlock configured to control access to the global spinlock. - View Dependent Claims (22, 23, 24, 25)
-
Specification