IP Library Granted Patent US 10,248,420
Granted Patent B2
US 10,248,420 · App. 15/609,211 · Granted Apr 2, 2019

Managing lock and unlock operations using active spinning

Inventors: Shubhendu Sekhar Mukherjee (Southborough, MA); Isam Wadih Akkawi (Santa Clara, CA); David Asher (Sutton, MA); Michael Bertone (Marlborough, MA); David Albert Carlson (Haslet, TX); Bradley Dobbie (Cambridge, MA); Richard Eugene Kessler (Northborough, MA)
Assignee: Cavium, LLC
G06F9/3009G06F9/30072G06F9/30079G06F9/4881G06F9/526G06F9/528G06F9/546
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,248,420
App. No.
15/609,211
Granted
Apr 2, 2019
Kind
B2
Abstract

Managing instructions on a processor includes: executing threads having access to a stored library of operations. For a first thread executing on the first processor core, for each instruction included in the first thread and identified as being associated with a lock operation corresponding to a particular lock, the managing includes determining if the particular lock has already been acquired for another thread executing on a processor core other than the first processor core, and if so, continuing to perform the lock operation for multiple attempts using a hardware lock operation different from the lock operation in the stored library, and if not, acquiring the particular lock for the first thread. The hardware lock operation performs a modified atomic operation that changes a result of the hardware lock operation for failed attempts to acquire the particular lock relative to a result of the lock operation in the stored library.

Claims (28)

1. A method for managing instructions on a processor comprising a plurality of processor cores, the method comprising:

executing a plurality of threads on the processor cores, each thread having access to a stored library of operations including at least one lock operation and at least one unlock operation; and

managing instructions that are issued on a first processor core of the plurality of processor cores, for a first thread executing on the first processor core, the managing including:

for each instruction included in the first thread and identified as being associated with a lock operation corresponding to a particular lock, determining if the particular lock has already been acquired for another thread executing on a processor core other than the first processor core, and if the particular lock has already been acquired, continuing to perform the lock operation for a plurality of attempts using a hardware lock operation different from the lock operation in the stored library, and if the particular lock has not already been acquired, acquiring the particular lock for the first thread, wherein the hardware lock operation performs a modified atomic operation that changes a result of the hardware lock operation for failed attempts to acquire the particular lock relative to a result of the lock operation in the stored library, and

for each instruction included in the first thread and identified as being associated with an unlock operation corresponding to a particular lock, releasing the particular lock from the first thread.

2. The method of claim 1 , wherein continuing to perform the lock operation for a plurality of attempts includes continuing to perform the lock operation for a plurality of attempts during which the first processor core is not able to execute threads other than the first thread.

3. The method of claim 2 , wherein, after a predetermined threshold on the plurality of attempts, the first processor core places the first thread into an inactive state that enables the first processor core to temporarily execute threads other than the first thread until the first thread is placed back into an active state.

4. The method of claim 3 , wherein, after releasing the particular lock from the first thread, the first processor core determines if there are any waiting threads executing on a processor core other than the first processor core that were placed into the inactive state after at least one attempt at acquiring the particular lock, and if so, places at least one waiting thread back into the active state.

5. The method of claim 1 , wherein the hardware lock operation different from the lock operation in the stored library is used in response to the lock operation in the stored library being invoked.

6. The method of claim 1 , wherein the hardware lock operation different from the lock operation in the stored library is performed by hardware within the first processor core that is configured to perform at least one of the plurality of attempts by re-issuing an instruction within a pipeline of the first processor core.

7. The method of claim 6 , wherein the re-issuing of the instruction is transparent to software being executed by the first thread.

8. The method of claim 1 , wherein interconnection circuitry configured to connect each processor core to a memory system of the processor is configured to preserve prioritization of selected messages associated with instructions identified as being associated with an unlock operation over messages associated with instructions identified as being associated with a lock operation.

9. The method of claim 1 , wherein the first processor core includes circuitry configured to identify selected instructions as being associated with operations from the stored library, the identifying including, for a plurality of instructions included in a particular thread executing on the processor, identifying a first subset of the plurality of instructions as being associated with a lock operation based on predetermined characteristics of the plurality of instructions, and identifying a second subset of the plurality of instructions as being associated with an unlock operation based on predetermined characteristics of the plurality of instructions.

10. The method of claim 9 , wherein the selected instructions are identified as being associated with operations from the stored library of operations using issue logic circuitry of a pipeline stage of the first processor core.

11. A processor comprising:

a plurality of processor cores, each configured to execute a plurality of threads, each thread having access to a stored library of operations including at least one lock operation and at least one unlock operation; and

instruction management circuitry in at least a first processor core of the plurality of processor cores, the instruction management circuitry configured to manage instructions that are issued on the first processor core, for a first thread executing on the first processor core, the managing including:

for each instruction included in the first thread and identified as being associated with a lock operation corresponding to a particular lock, determining if the particular lock has already been acquired for another thread executing on a processor core other than the first processor core, and if the particular lock has already been acquired, continuing to perform the lock operation for a plurality of attempts using a hardware lock operation different from the lock operation in the stored library, and if the particular lock has not already been acquired, acquiring the particular lock for the first thread, wherein the hardware lock operation performs a modified atomic operation that changes a result of the hardware lock operation for failed attempts to acquire the particular lock relative to a result of the lock operation in the stored library, and

for each instruction included in the first thread and identified as being associated with an unlock operation corresponding to a particular lock, releasing the particular lock for the first thread.

12. The processor of claim 11 , wherein continuing to perform the lock operation for a plurality of attempts includes continuing to perform the lock operation for a plurality of attempts during which the first processor core is not able to execute threads other than the first thread.

13. The processor of claim 12 , wherein, after a predetermined threshold on the plurality of attempts, the first processor core places the first thread into an inactive state that enables the first processor core to temporarily execute threads other than the first thread until the first thread is placed back into an active state.

14. The processor of claim 13 , wherein, after releasing the particular lock from the first thread, the first processor core determines if there are any waiting threads executing on a processor core other than the first processor core that were placed into the inactive state after at least one attempt at acquiring the particular lock, and if so, places at least one waiting thread back into the active state.

15. The processor of claim 11 , wherein the hardware lock operation different from the lock operation in the stored library is used in response to the lock operation in the stored library being invoked.

16. The processor of claim 11 , wherein the hardware lock operation different from the lock operation in the stored library is performed by hardware within the first processor core that is configured to perform at least one of the plurality of attempts by re-issuing an instruction within a pipeline of the first processor core.

17. The processor of claim 16 , wherein the re-issuing of the instruction is transparent to software being executed by the first thread.

18. The processor of claim 11 , further comprising interconnection circuitry configured to connect each processor core to a memory system of the processor is configured to preserve prioritization of selected messages associated with instructions identified as being associated with an unlock operation over messages associated with instructions identified as being associated with a lock operation.

19. The processor of claim 11 , wherein the first processor core includes circuitry configured to identify selected instructions as being associated with operations from the stored library, the identifying including, for a plurality of instructions included in a particular thread executing on the processor, identifying a first subset of the plurality of instructions as being associated with a lock operation based on predetermined characteristics of the plurality of instructions, and identifying a second subset of the plurality of instructions as being associated with an unlock operation based on predetermined characteristics of the plurality of instructions.

20. The processor of claim 19 , wherein the selected instructions are identified as being associated with operations from the stored library of operations using issue logic circuitry of a pipeline stage of the first processor core.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 15, 2020
From: CAVIUM INTERNATIONAL
To: MARVELL ASIA PTE, LTD.
Reel/Frame 053179/0320 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 17, 2020
From: CAVIUM, LLC
To: CAVIUM INTERNATIONAL
Reel/Frame 051948/0807 →
ENTITY CONVERSION Recorded Sep 27, 2018
From: CAVIUM, INC.
To: CAVIUM, LLC
Reel/Frame 047674/0131 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 23, 2017
From: AKKAWI, ISAM WADIH; ASHER, DAVID; BERTONE, MICHAEL; CARLSON, DAVID ALBERT; DOBBIE, BRADLEY; KESSLER, RICHARD EUGENE; MUKHERJEE, SHUBHENDU SEKHAR
To: CAVIUM, INC.
Reel/Frame 043364/0428 →
Continuity (2)
Provisional Application 62481891 · Apr 5, 2017
Related Publication 20180293113A1 · Oct 11, 2018
Cited By (1)
US 12,566,646