# US 2023/0273779 A1 · Operating system (os) scheduler and compiler for code generation optimization in a (simultaneous multi-threading) smt enabled cpu

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0273779 A1
- Document ID: US20230273779A1
- Status: Published application
- Kind: A1
- Application number: 17/652,572
- Filed: 2022-02-25
- Published: 2023-08-31
- Earliest claimed: 2022-02-25
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Zheng Chen; JIU FU GUO; Gui HaoChen; Chaofan Qiu
- Web page: https://patentgrep.com/patent/US20230273779A1

## CPC

- G06F 8/443: {Optimisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method, computer program product, and computer system are provided. An enhanced compiler identifies instructions for execution among them, instructions directed to an inner computation unit of a CPU core. In response to identifying instructions directed to the inner computation unit, locating in a system call table a system call to indicate a begin of an executable code block of instructions that are directed to the inner computation unit of the CPU core. The enhanced compiler searches the system hardware registry for the parameter corresponding to the inner computation unit of the CPU core. The system call is inserted as an interrupt instruction in the compiler output at the begin of the executable code block of instructions that are directed to the inner computation unit of the CPU core. The enhanced compiler executable code output is saved for later selection by a scheduler of an operating system.

## Claims

### Claim 1

A method, comprising:
profiling, by an enhanced compiler, source code input to identify instructions to be executed, and among the instructions to be executed, instructions directed to an inner computation unit of a CPU core;
in response to identifying instructions directed to the inner computation unit of the CPU core, locating in a system call table a system call to indicate a begin of an executable code block of instructions that are directed to the inner computation unit of the CPU core;
searching a system hardware registry for a parameter corresponding to the inner computation unit of the CPU core;
inserting the system call as an interrupt instruction in the compiler output at the begin of the executable code block of instructions that are directed to the inner computation unit of the CPU core, wherein the executable code block includes the parameter corresponding to the inner computation unit of the CPU core; and
saving the enhanced compiler executable code output for later selection by a scheduler of an operating system.

### Claim 2 (depends on 1)

The method of claim 1, wherein the enhanced compiler is provided as an enhancement to an existing non-enhanced compiler.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
an enhanced scheduler selecting a runnable thread of the enhanced compiler executable code output to execute;
in response to finding the system call to indicate the begin of the executable code block of instructions, choosing an available inner computation unit corresponding to the parameter in the system call;
dispatching the thread associated with the executable code block to the core of the CPU having the available inner computation unit; and
incrementing the internal counter corresponding to the inner computation unit and CPU receiving the dispatched thread.

### Claim 4 (depends on 3)

The method of claim 3, wherein upon completion of the thread, the enhanced scheduler decrements the internal counter corresponding to the inner computation unit and CPU receiving the dispatched thread.

### Claim 5 (depends on 1)

The method of claim 1, wherein the enhanced scheduler selects the enhanced compiler executable code output for execution based on a least busy inner computation unit of its type.

### Claim 6 (depends on 1)

The method of claim 1, wherein the enhanced scheduler selects a default scheduling algorithm based on no available inner computation unit corresponding to the parameter in the system call.

### Claim 7 (depends on 1)

The method of claim 1, wherein the enhanced compiler executable code output is based on granularity of inner computation unit requirements of individual threads, and wherein the enhanced scheduler dispatches based on granularity of the thread.

### Claim 8

A computer program product, the computer program product comprising a non-transitory tangible storage device having program code embodied therewith, the program code executable by a processor of a computer to perform a method, the method comprising:
profiling, by an enhanced compiler, source code input to identify instructions to be executed, and among the instructions to be executed, instructions directed to an inner computation unit of a CPU core;
in response to identifying instructions directed to the inner computation unit of the CPU core, locating in a system call table a system call to indicate a begin of an executable code block of instructions that are directed to the inner computation unit of the CPU core;
searching a system hardware registry for a parameter corresponding to the inner computation unit of the CPU core;
inserting the system call as an interrupt instruction in the compiler output at the begin of the executable code block of instructions that are directed to the inner computation unit of the CPU core, wherein the executable code block includes the parameter corresponding to the inner computation unit of the CPU core; and
saving the enhanced compiler executable code output for later selection by a scheduler of an operating system.

### Claim 9 (depends on 8)

The computer program product of claim 8, wherein the enhanced compiler is provided as an enhancement to an existing non-enhanced compiler.

### Claim 10 (depends on 8)

The computer program product of claim 8, further comprising:
an enhanced scheduler selecting a runnable thread of the enhanced compiler executable code output to execute;
in response to finding the system call to indicate the begin of the executable code block of instructions, choosing an available inner computation unit corresponding to the parameter in the system call;
dispatching the thread associated with the executable code block to the core of the CPU having the available inner computation unit; and
incrementing the internal counter corresponding to the inner computation unit and CPU receiving the dispatched thread.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein upon completion of the thread, the enhanced scheduler decrements the internal counter corresponding to the inner computation unit and CPU receiving the dispatched thread.

### Claim 12 (depends on 8)

The computer program product of claim 8, wherein the enhanced scheduler is provided as an enhancement to an existing non-enhanced scheduler.

### Claim 13 (depends on 8)

The computer program product of claim 8, wherein the enhanced scheduler selects the enhanced compiler executable code output for execution based on a least busy inner computation unit of its type.

### Claim 14 (depends on 8)

The computer program product of claim 8, wherein the enhanced scheduler selects a default scheduling algorithm based on no available inner computation unit corresponding to the parameter in the system call.

### Claim 15 (depends on 8)

The computer program product of claim 8, wherein the enhanced compiler executable code output is based on granularity of inner computation unit requirements of individual threads, and wherein the enhanced scheduler dispatches based on granularity of the thread.

### Claim 16

A computer system, comprising:
one or more processors;
a memory coupled to at least one of the processors;
a set of computer program instructions stored in the memory and executed by at least one of the processors in order to perform actions of:
profiling, by an enhanced compiler, source code input to identify instructions to be executed, and among the instructions to be executed, instructions directed to an inner computation unit of a CPU core;
in response to identifying instructions directed to the inner computation unit of the CPU core, locating in a system call table a system call to indicate a begin of an executable code block of instructions that are directed to the inner computation unit of the CPU core;
searching a system hardware registry for a parameter corresponding to the inner computation unit of the CPU core;
inserting the system call as an interrupt instruction in the compiler output at the begin of the executable code block of instructions that are directed to the inner computation unit of the CPU core, wherein the executable code block includes the parameter corresponding to the inner computation unit of the CPU core; and
saving the enhanced compiler executable code output for later selection by a scheduler of an operating system.

### Claim 17 (depends on 16)

The computer system of claim 16, wherein the enhanced compiler is provided as an enhancement to an existing non-enhanced compiler.

### Claim 18 (depends on 16)

The computer system of claim 16, further comprising:
an enhanced scheduler selecting a runnable thread of the enhanced compiler executable code output to execute;
in response to finding the system call to indicate the begin of the executable code block of instructions, choosing an available inner computation unit corresponding to the parameter in the system call;
dispatching the thread associated with the executable code block to the core of the CPU having the available inner computation unit;
incrementing the internal counter corresponding to the inner computation unit and CPU receiving the dispatched thread; and
upon completion of the thread, the enhanced scheduler decrements the internal counter corresponding to the inner computation unit and CPU receiving the dispatched thread.

### Claim 19 (depends on 16)

The computer system of claim 16, wherein the enhanced scheduler selects the enhanced compiler executable code output for execution based on a least busy inner computation unit of its type.

### Claim 20 (depends on 16)

The computer system of claim 16, wherein the enhanced scheduler selects a default scheduling algorithm based on no available inner computation unit corresponding to the parameter in the system call.
