IP Library Granted Patent US 9,158,595
Granted Patent B2
US 9,158,595 · App. 13/660,741 · Granted Oct 13, 2015

Hardware scheduling of ordered critical code sections

Inventors: John Erik Lindholm (Saratoga, CA); Tero Tapani Karras (Helsinki, FI); Samuli Matias Laine (Vantaa, FI); Timo Aila (Tuusula, FI)
Assignee: NVIDIA Corporation
G06F9/522G06F9/4881G06F2209/484
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 9,158,595
App. No.
13/660,741
Granted
Oct 13, 2015
Kind
B2
Abstract

One embodiment sets forth a technique for scheduling the execution of ordered critical code sections by multiple threads. A multithreaded processor includes an instruction scheduling unit that is configured to schedule threads to process ordered critical code sections. A ordered critical code section is preceded by a barrier instruction and when all of the threads have reached the barrier instruction, the instruction scheduling unit controls the thread execution order by selecting each thread for execution based on logical identifiers associated with the threads. The logical identifiers are mapped to physical identifiers that are referenced by the multithreaded processor during execution of the threads. The logical identifiers are used by the instruction scheduling unit to control the order in which the threads execute the ordered critical code section.

Claims (46)

1. A computer-implemented method for scheduling an ordered critical code section, the method comprising:

associating threads in a thread array with logical identifiers that are mapped to physical identifiers, wherein the physical identifiers are referenced by a multi-threaded processing core during execution of the threads;

initiating execution of the threads to process instructions of a program that includes the ordered critical code section;

waiting for a last arriving thread in the thread array, wherein the last arriving thread reaches the ordered critical code section last, relative to other threads in the thread array;

selecting, based on the logical identifiers associated with the threads in the thread array, a first thread of the threads for execution by the multi-threaded processing core; and

executing, by the multi-threaded processing core, the first thread to process the ordered critical code section.

2. The method of claim 1 , wherein the last arriving thread and the first thread are participating threads in a barrier instruction that delineates the ordered critical code section.

3. The method of claim 2 , wherein the steps of selecting and executing are repeated for at least one additional thread in the thread array that participates in the barrier instruction.

4. The method of claim 1 , wherein each thread in the thread array specifies a barrier identifier for each barrier instruction for which the thread participates.

5. The method of claim 4 , further comprising prior to selecting the first thread, generating a mask based on a first barrier identifier specified by the first thread and by a first barrier instruction that delineates the ordered critical code section.

6. The method of claim 5 , further comprising, updating the mask after the first thread executes the ordered critical code section.

7. The method of claim 1 , further comprising, waiting for the first thread to execute all instructions within the ordered critical code section before selecting another thread of the thread array to execute the ordered critical code section.

8. The method of claim 1 , wherein the first thread continues execution of at least one instruction immediately subsequent to the ordered critical code section in program order before at least one other thread of the thread array executes at least one instruction within the ordered critical code section.

9. The method of claim 1 , wherein the first thread waits for the last thread to complete execution of the ordered critical code section before the first thread executes any instruction after the ordered critical code section in program order.

10. The method of claim 1 , further comprising:

before selecting the first thread, determining that no other are executing a different ordered critical code section; and

preventing the plurality of threads in the second thread array from executing on the multi-threaded processing core until after the threads of the thread array have completed execution of the ordered critical code section.

11. The method of claim 1 , further comprising synchronizing access to a shared processing resource based on the ordered critical section.

12. A processing subsystem comprising:

an instruction scheduling unit, configured to:

associate threads in a thread array with logical identifiers that are mapped to physical identifiers, wherein the physical identifiers are referenced by a multi-threaded processing core during execution of the threads;

initiate execution of the threads to process instructions of a program that includes an ordered critical code section;

wait for a last arriving thread in the thread array, wherein the last arriving thread reaches the ordered critical code section last, relative to other threads in the thread array;

select, based on the logical identifiers associated with the threads in the thread array, a first thread of the threads for execution by the multi-threaded processing core; and

the multi-threaded processing core that is configured to execute the first thread to process the ordered critical code section.

13. The processing subsystem of claim 12 , wherein the last thread and the first thread are participating threads in a barrier instruction that delineates the ordered critical code section.

14. The processing subsystem of claim 13 , wherein the steps of selecting and executing are repeated for at least one additional thread in the thread array that participates in the barrier instruction.

15. The processing subsystem of claim 12 , further comprising a shared processing resource, wherein the instruction scheduling unit is further configured to:

wait for a plurality of threads in a second thread array to reach a critical code section;

select a second thread in the second thread array for execution by a shared processing resource that is separate from the multi-threaded processing core; and

simultaneously execute the second thread by the shared processing resource to process instructions within the critical code section and the first thread by the multi-threaded processing core to process instructions within the ordered critical code section.

16. The processing subsystem of claim 12 , wherein the instruction scheduling unit is further configured to wait for the first thread to execute all instructions within the ordered critical code section before selecting another thread of the thread array to execute the ordered critical code section.

17. The processing subsystem of claim 12 , wherein the first thread continues execution of at least one instruction immediately subsequent to the ordered critical code section in program order before at least one other thread of the thread array executes at least one instruction within the ordered critical code section.

18. The processing subsystem of claim 12 , wherein the instruction scheduling unit is further configured to wait for the last thread to complete execution of the ordered critical code section before the first thread executes any instruction after the ordered critical code section in program order.

19. The processing subsystem of claim 12 , wherein the instruction scheduling unit is further configured to:

before selecting the first thread, determine that a plurality of threads in a second thread array are not executing a different ordered critical code section; and

prevent the plurality of threads in the second thread array from executing until after the threads of the thread array have completed execution of the ordered critical code section.

20. A computing system, comprising:

a processing subsystem comprising:

an instruction scheduling unit, configured to:

associate threads in a thread array with logical identifiers that are mapped to physical identifiers, wherein the physical identifiers are referenced by a multi-threaded processing core during execution of the threads;

initiate execution of the threads to process instructions of a program that includes an ordered critical code section;

wait for a last arriving thread in the thread array, wherein the last arriving thread reaches the ordered critical code section last, relative to other threads in the thread array;

select, based on the logical identifiers associated with the threads in the thread array, a first thread of the threads for execution by the multi-threaded processing core; and

the multi-threaded processing core that is configured to execute the first thread to process the ordered critical code section.

21. The method of claim 1 , wherein each logical identifier included in the logical identifiers indicates an order in which processing work associated with the logical identifier is received.

Assignments (2)
CONFIRMATORY LICENSE Recorded Apr 10, 2015
From: NVIDIA CORP
To: DARPA
Reel/Frame 035414/0779 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 25, 2012
From: LINDHOLM, JOHN ERIK; KARRAS, TERO TAPANI; LAINE, SAMULI MATIAS; AILA, TIMO
To: NVIDIA CORPORATION
Reel/Frame 029194/0893 →
Continuity (1)
Related Publication 20140123150A1 · May 1, 2014