IP Library Granted Patent US 11,625,249
Granted Patent B2
US 11,625,249 · App. 17/137,140 · Granted Apr 11, 2023

Preserving memory ordering between offloaded instructions and non-offloaded instructions

Inventors: Jagadish B. Kotra (Austin, TX); John Kalamatianos (Boxborough, MA)
Assignee: ADVANCED MICRO DEVICES, INC.
G06F9/3836G06F9/3001G06F9/3877G06F9/522
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,625,249
App. No.
17/137,140
Granted
Apr 11, 2023
Kind
B2
Abstract

Preserving memory ordering between offloaded instructions and non-offloaded instructions is disclosed. An offload instruction for an operation to be offloaded is processed and a lock is placed on a memory address associated with the offload instruction. In response to completing a cache operation targeting the memory address, the lock on the memory address is removed. For multithreaded applications, upon determining that a plurality of processor cores have each begun executing a sequence of offload instructions, the execution of non-offload instructions that are younger than any of the offload instructions is restricted. In response to determining that each processor core has completed executing its sequence of offload instructions, the restriction is removed. The remote device may be, for example, a processing-in-memory device or an accelerator coupled to a memory.

Claims (46)

1. A method of preserving memory ordering between offloaded instructions and non-offloaded instructions, the method comprising:

processing at least one Processing-in-memory (PIM) offload instruction;

placing a lock on a memory address associated with the at least one PIM offload instruction; and

removing the lock on the memory address in response to completing an operation targeting the memory address, wherein completing the operation targeting the memory address includes sending a probe request to one or more caches of one or more cores that contain an entry for the memory address.

2. The method of claim 1 , wherein placing a lock on a memory address associated with the at least one PIM offload instruction includes storing the memory address in an entry of an address lock buffer; and wherein removing the lock on the memory address includes clearing the entry in the address lock buffer.

3. The method of claim 1 , wherein the probe request indicates that data in the entry should be either invalidated or flushed.

4. The method of claim 1 , wherein the lock is placed after processing at least one PIM offload instruction and wherein the lock is removed prior to execution of the operation on an offload target device.

5. The method of claim 1 further comprising:

determining that a plurality of processor cores have each begun executing a respective sequence of PIM offload instructions, wherein respective sequences of PIM offload instructions executing on the plurality of processor cores share a process identifier;

restricting execution of non-offload instructions that are younger than any of the PIM offload instructions; and

in response to determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions, removing the restriction.

6. The method of claim 5 , wherein determining that a plurality of processor cores have each begun executing a respective sequence of PIM offload instructions, wherein respective sequences of PIM offload instructions executing on the plurality of processor cores share a process identifier includes determining that the plurality of processor cores have executed a start barrier instruction in the respective sequences of PIM offload instructions.

7. The method of claim 6 , wherein the start barrier instruction is used to identify a number of processor cores that are co-executing the respective sequence of PIM offload instructions.

8. The method of claim 5 , wherein determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions includes determining that an end barrier instruction has been executed on each core.

9. The method of claim 8 , wherein determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions includes determining that all memory address locks triggered by the sequence of PIM offload instructions have been removed.

10. The method of claim 5 , wherein determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions includes tracking progress of each core.

11. The method of claim 1 , wherein the PIM offload instruction is for an operation to be offloaded to a processing-in-memory (PIM) device.

12. A multicore processor configured to:

process at least one Processing-in-memory (PIM) offload instruction;

place a lock on a memory address associated with the at least one PIM offload instruction; and

remove the lock on the memory address in response to completing an operation targeting the memory address, wherein completing the operation targeting the memory address includes sending a probe request to one or more caches of one or more cores that contain an entry for the memory address.

13. The processor of claim 12 , wherein placing a lock on a memory address represented associated with the at least one PIM offload instruction includes storing the memory address in an entry of an address lock buffer; and wherein removing the lock on the memory address includes clearing the entry in the address lock buffer.

14. The processor of claim 12 , wherein the probe request indicates that data in the entry should be either invalidated or flushed.

15. The processor of claim 12 , wherein the processor is further configured to:

determine that a plurality of processor cores have each begun executing a respective sequence of PIM offload instructions, wherein respective sequences of PIM offload instructions executing on the plurality of processor cores share a process identifier;

restrict execution of non-offload instructions that are younger than any of the PIM offload instructions; and

in response to determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions, remove the restriction.

16. The processor of claim 15 , wherein determining that a plurality of processor cores have each begun executing a respective sequence of PIM offload instructions, wherein respective sequences of PIM offload instructions executing on the plurality of processor cores share a process identifier, includes determining that each core has executed a start barrier instruction in the respective sequences of PIM offload instructions,

wherein determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions includes:

determining that an end barrier instruction has been executed on each core; and

determining that all memory address locks triggered by the sequence of PIM offload instructions have been removed.

17. A system comprising:

a processing-in-memory (PIM) device; and

a multicore processor coupled to the PIM device, the processor configured to:

process at least one Processing-in-memory (PIM) offload instruction;

place a lock on a memory address associated with the at least one PIM offload instruction; and

remove the lock on the memory address in response to completing an operation targeting the memory address, wherein completing the operation targeting the memory address includes sending a probe request to one or more caches of one or more cores that contain an entry for the memory address.

18. The system of claim 17 , wherein the probe request indicates that data in the entry should be either invalidated or flushed.

19. The system of claim 17 , wherein the processor is further configured to:

determine that a plurality of processor cores have each begun executing a respective sequence of PIM offload instructions, wherein respective sequences of PIM offload instructions executing on the plurality of processor cores share a process identifier;

restrict execution of non-offload instructions that are younger than any of the PIM offload instructions; and

in response to determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions, remove the restriction.

20. The system of claim 19 , wherein determining that a plurality of processor cores have each begun executing a respective sequence of PIM offload instructions, wherein respective sequences of PIM offload instructions executing on the plurality of processor cores share a process identifier, includes determining that each core has executed a start barrier instruction in the respective sequences of PIM offload instructions,

wherein determining that each of plurality of processor cores has completed the respective sequence of PIM offload instructions includes:

determining that an end barrier instruction has been executed on each processor core; and

determining that all memory address locks triggered by the sequence of PIM offload instructions have been removed.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 8, 2021
From: KOTRA, JAGADISH B.; KALAMATIANOS, JOHN
To: ADVANCED MICRO DEVICES, INC.
Reel/Frame 054858/0161 →
Continuity (1)
Related Publication 20220206817A1 · Jun 30, 2022
Cited By (6)
US 12,197,378 US 12,265,470 US 12,379,928 US 12,455,826 US 12,596,650 US 12,681,866