IP Library › Granted Patent US 11,157,407
Granted Patent B2
US 11,157,407 · App. 15/841,974 · Granted Oct 26, 2021

Implementing atomic primitives using cache line locking

Inventors: Mayan Moudgill (Chapaqua, NY); A. Joseph Hoane (Yonkers, NY)
Assignee: Optimum Semiconductor Technologies Inc.
G06F12/0817G06F9/3004G06F9/30047G06F9/30087G06F9/526G06F9/54G06F12/084G06F12/0811G06F12/0895G06F2212/62
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 11,157,407
App. No.
15/841,974
Granted
Oct 26, 2021
Kind
B2
Abstract

A processor comprising a cache, the cache comprising a cache line, an execution unit to execute an atomic primitive to responsive to executing a read instruction to retrieve a data item from a memory location, cause to store a copy of the data item in the cache line, execute a lock instruction to lock the cache line to the processor, execute at least one instruction while the cache line is locked to the processor, and execute an unlock instruction to cause the cache controller to release the cache line from the processor.

Claims (49)

1. A method of executing an atomic primitive, wherein the atomic primitive is implemented in hardware and is defined in an instruction set of architecture (ISA) of the processor, the atomic primitive comprising built-in operations comprising:

responsive to executing a read instruction to retrieve a data item from a memory location, causing to store a copy of the data item in a cache line of a cache;

executing a lock instruction to cause a cache controller to lock the cache line to the processor, wherein to lock the cache line, the cache controller is to set a lock status flag in the cache line and is to prevent other processors from modifying the data item stored at the memory location;

determining whether execution of the lock instruction is successful;

responsive to determining that the execution of the lock instruction is successful,

guaranteeing that the memory location is locked to the processor until completion of executing an unlock instruction; and

executing at least one instruction while the cache line is locked to the processor; and

responsive to determining that the execution of the lock instruction fails,

return a status flag indicating that the execution fails;

branch to a pre-determined memory address; and

trigger an exception to notify an exception handler; and

executing the unlock instruction to cause the cache controller to release the lock of the cache line from the processor.

2. The method of claim 1 , wherein the cache is one of an L1 data cache or an L2 data cache.

3. The method of claim 1 , further comprising:

determining that the cache line is in an exclusive state under a cache coherence protocol; and

responsive to determining that the cache line is in the exclusive state, marking the cache line as locked to the processor.

4. The method of claim 1 , wherein marking the cache line as locked to the processor further comprises setting a lock status flag in the cache line.

5. The method of claim 4 , wherein responsive to completing execution of the at least one instruction, unsetting the lock status flag in the cache line.

6. The method of claim 1 , further comprising:

responsive to identifying a request to access the cache line by a second processor, delaying granting access by the second processor to the cache line until the completing execution of the plurality of instructions.

7. A processor comprising:

a cache, the cache comprising a cache line; and

an execution circuit to execute an atomic primitive, wherein the atomic primitive is implemented in hardware and is defined in an instruction set of architecture (ISA) of the processor, the atomic primitive comprising built-in operations to:

responsive to executing a read instruction to retrieve a data item from a memory location, cause to store a copy of the data item in the cache line;

execute a lock instruction to cause a cache controller to lock the cache line to the processor, wherein to lock the cache line, the cache controller is to set a lock status flag in the cache line and is to prevent other processors from modifying the data item stored at the memory location;

determine whether execution of the lock instruction is successful;

responsive to determining that the execution of the lock instruction is successful,

guarantee that the memory location is locked to the processor until completion of executing an unlock instruction; and

execute at least one instruction while the cache line is locked to the processor; and

responsive to determining that the execution of the lock instruction fails,

return a status flag indicating that the execution fails;

branch to a pre-determined memory address; and

trigger an exception to notify an exception handler; and

execute the unlock instruction to cause the cache controller to release the lock of the cache line from the processor.

8. The processor of claim 7 , wherein the cache is one of an L1 data cache or an L2 data cache.

9. The processor of claim 7 , wherein the cache controller associated with the processor is to:

determine that the cache line is in an exclusive state under a cache coherence protocol; and

responsive to determining that the cache line is in the exclusive state, mark the cache line as locked to the processor.

10. The processor of claim 7 , wherein the execution circuit is to mark the cache line as locked to the processor responsive to setting the lock status flag in the cache line.

11. The processor of claim 10 , wherein to release the cache line from the processor, the cache controller is to unset the lock status flag in the cache line.

12. The processor of claim 7 , further comprising:

identifying a request to access the cache line by a second processor; and

causing the cache controller to delay granting access by the second processor to the cache line until the execution circuit completes execution of the at least one instruction.

13. The processor of claim 7 , wherein the cache controller is to access a pool to store a plurality of memory addresses that correspond to locked cache lines, and wherein to lock the cache line to the processor, the cache controller is to place a memory address associated with the cache line in the pool.

14. The processor of claim 13 , wherein the cache controller is to remove the memory address from the pool to unlock the cache line.

15. The processor of claim 7 , wherein the lock instruction is a privileged instruction of an operating system, and wherein the unlock instruction is a privileged instruction of the operating system.

16. The processor of claim 15 , wherein the processor is to support the operating system to call the atomic primitive.

17. The processor of claim 7 , wherein at least one processor other than the processor is denied access to the cache line while the cache line is locked to the processor.

18. The processor of claim 7 , wherein a second processor is to access the cache line while the cache line is unlocked.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 20, 2017
From: MOUDGILL, MAYAN; HOANE, A. JOSEPH
To: OPTIMUM SEMICONDUCTOR TECHNOLOGIES, INC.
Reel/Frame 044450/0044 →
Continuity (2)
Provisional Application 62434525 · Dec 15, 2016
Related Publication 20180173625A1 · Jun 21, 2018