IP Library › Granted Patent US 10,831,537
Granted Patent B2
US 10,831,537 · App. 15/435,803 · Granted Nov 10, 2020

Dynamic update of the number of architected registers assigned to software threads using spill counts

Inventors: Harold W. Cain, III (Raleigh, NC); Hubertus Franke (Cortlandt Manor, NY); Charles R. Johns (Austin, TX); Hung Q. Le (Austin, TX); Ravi Nair (Briarcliff Manor, NY)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F9/50G06F9/3012G06F9/30098G06F9/30123G06F9/384G06F9/3851G06F9/45516
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,831,537
App. No.
15/435,803
Granted
Nov 10, 2020
Kind
B2
Abstract

A computer system includes a processor, main memory, and controller. The processor includes a plurality of hardware threads configured to execute a plurality of software threads. The main memory includes a first register table configured to contain a current set of architected registers for the currently running software threads. The controller is configured to change a first number of the architected registers assigned to a given one of the software threads to a second number of architected registers when a result of monitoring current usage of the registers by the software threads indicates that the change will improve performance of the computer system. The processor includes a second register table configured to contain a subset of the architected registers and a mapping table for each software thread indicating whether the architected registers referenced by the corresponding software thread are located in the first register table or the second register table.

Claims (23)

1. A computer system comprising:

a processor comprising a plurality of hardware threads configured to execute a plurality of software threads and a physical register file including a plurality of physical registers, where an architecture of the processor specifies a certain number of architected registers;

a main memory comprising a virtual register file including a plurality of virtual registers; and

a controller configured to initially assign some of the architected registers to each of the software threads, monitor each of the software threads to determine whether a first number of the architected registers assigned to a first software thread among the software threads is sufficient, and assign a second number of the architected registers to the first software thread different from the first number when it determines that the first number is not sufficient,

wherein the processor includes a mapping table for each software thread indicating whether each of the architected registers assigned to the corresponding software thread is mapped to one of the physical registers in the physical register file or mapped to one of the virtual registers in the virtual register file,

wherein the controller comprises a spill counter for each of the software threads, where each spill counter generates a spill count indicating how many times the corresponding software thread causes contents of one of the physical registers associated with another one of the software threads to be copied to one of the virtual registers, and wherein the controller determines whether the first number of the architected registers assigned to the first software thread is sufficient based on the spill counts.

2. The computer system of claim 1 , wherein the mapping table for a given software thread of the software threads includes an entry for each the architected registers assigned to the given software thread, wherein the entry includes a bit indicating whether one of the architected registers assigned to the given software thread is mapped to one of the physical registers in the physical register file or is mapped to one of the virtual registers in the virtual register file.

3. The computer system of claim 1 , wherein the processor is configured to periodically free one of the physical registers.

4. The computer system of claim 3 , wherein the processor frees the one physical register by selecting one of the physical registers and writing contents of the selected physical register to one of the virtual registers.

5. The computer system of claim 4 , wherein the processor chooses the selected physical register using a least recently used strategy or a predicted degree of use strategy.

6. The computer system of claim 1 , wherein the controller recompiles the first software thread to use the second number of the architected registers.

7. The computer system of claim 6 , wherein the controller is configured to send an interrupt to one of the hardware threads that is executing the first software thread to assign the second number of the architected registers to the first software thread.

8. The computer system of claim 7 , wherein an interrupt handler of the one hardware thread is configured to set a software flag to indicate assignment of the second number of the architected registers to the first software thread is to occur.

9. The computer system of claim 8 , further comprising a compiler configured to re-compile the first software thread to use the second number of the architected registers upon accessing the software flag.

10. The computer system of claim 9 , wherein the processor is configured to resume the re-compiled first software thread.

11. The computer system of claim 7 , wherein an interrupt handler of the one hardware thread is configured to stall the first software thread upon receipt of the interrupt.

12. The computer system of claim 1 , wherein the controller further comprises:

a plurality of instruction counters for each of the software threads, wherein each instruction counter generates an instruction count indicating how many instructions the corresponding software thread executed, and

wherein the controller determines whether the first number of the architected registers assigned to the first software thread is sufficient based on the split counts and the instruction counts.

13. The computer system of claim 12 , wherein the controller, for each of the software threads, divides the spill count of the corresponding software thread by the instruction count of the corresponding software thread to determine a usage factor for the corresponding software thread, and the controller determines whether the first number of the architected registers assigned to the first software thread is sufficient based on the usage factors.

14. The computer system of claim 13 , wherein the controller sets the second number to a value less than the first number when one of the usage factors is higher than a threshold and the usage factor of the first software thread indicates the first software thread is spilling the least among the software threads.

15. The computer system of claim 13 , wherein the controller sets the second number to a value greater than the first number when one of the usage factors is lower than a threshold and the usage factor of the first software thread indicates the first software thread is spilling the most among the software threads.

16. The computer system of claim 1 , wherein a given software thread of the software threads causes contents of one of the physical registers associated with another one of the software threads to be copied to one of the virtual registers when an instruction of the given software thread requires a new one of the architected registers and all of the physical registers are mapped.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE ASSIGNOR PREVIOUSLY RECORDED ON REEL 041286 FRAME 0503. ASSIGNOR(S) HEREBY CONFIRMS THE ADDITION OF ASSIGNOR: JAMES A. KAHLE. Recorded Jun 21, 2021
From: CAIN III, HAROLD W.; FRANKE, HUBERTUS; JOHNS, CHARLES R.; LE, HUNG Q.; NAIR, RAVI; KAHLE, JAMES A.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 056928/0510 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 17, 2017
From: CAIN III, HAROLD W.; FRANKE, HUBERTUS; JOHNS, CHARLES R.; LE, HUNG Q.; NAIR, RAVI
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 041286/0503 →
Continuity (1)
Related Publication 20180239604A1 · Aug 23, 2018