# US 2021/0240528 A1 · Apparatus and method for deferral scheduling of tasks for operating system on multi-core processor

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

- Number: US 2021/0240528 A1
- Document ID: US20210240528A1
- Status: Published application
- Kind: A1
- Application number: 17/155,681
- Filed: 2021-01-22
- Published: 2021-08-05
- Earliest claimed: 2018-04-19
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Anup Manohar KAVERI; Vinayak HANAGANDI; Nischal JAIN; Rohit Kumar SARAF; Shwetang SINGH; Samarth VARSHNEY; Srinivasa Rao KOLA; Younjo OH
- Web page: https://patentgrep.com/patent/US20210240528A1

## CPC

- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/461: {Saving or restoring of program or task context}
- G06F 9/4812: {by interrupt, e.g. masked}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 9/4887: {involving deadlines, e.g. rate based, periodic}
- G06F 2209/483: Multiproc
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided is a method for scheduling of tasks for an operating system on a multi-core processor. The method includes receiving a system call for initiating a scheduling operation on a second core and invoking a scheduling instance to the second core, and the scheduling instance notifies the scheduling operation of an incoming high priority task. Further, the method includes deferring a switching context instance at the second core, and the deferring the switching context instance at the second core includes unblocking the first core to perform other tasks.

## Claims

### Claim 1

A method for scheduling of tasks for an operating system on a multi-core processor, the method comprising:
receiving a system call for initiating a scheduling operation on a second core;
invoking a scheduling instance to the second core, wherein the scheduling instance notifies the scheduling operation based on a priority of the tasks;
deferring a switching context instance at the second core; and
executing the deferred switching context instance when an interrupt is received by the second core.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
executing at least one other system call on at least one core, and
wherein the executing the deferred switching context comprises executing the deferred switching context instance by determining an imbalance in the at least one core when the interrupt is received by the second core.

### Claim 3 (depends on 1)

The method of claim 1, wherein the scheduling instance is invoked by sending the interrupt,
wherein the scheduling operation comprises executing an incoming high priority task on the second core, and
wherein the scheduling instance comprises at least one of:
preempting a currently running task, wherein the currently running task is running on the second core;
suspending the currently running task; and
balancing the currently running task.

### Claim 4 (depends on 3)

The method of claim 3, wherein the preempting the currently running task comprises:
determining a preemption condition by tracking priorities of the currently running task on the second core and a plurality of tasks which are in a ready state;
determining whether the preemption of the currently running task on the second core needs to be carried out successively in the scheduling instance or to be deferred; and
performing one of:
saving a context of a task to be preempted and restoring a context of a task to be executed when the preemption needs to be carried out successively in the scheduling instance, wherein the task to be preempted is the currently running task on the second core and the task to be executed is a task having a higher priority than the currently running task on the second core, and
performing a system state handling and signaling when the preemption is to be deferred.

### Claim 5 (depends on 3)

The method of claim 3, wherein the suspending the currently running task comprises:
determining that the currently running task is to be suspended;
saving a context of the currently running task and suspending the currently running task;
determining a next highest priority task to be scheduled into a running state; and
performing one of:
scheduling the next highest priority task successively in a suspension instance, and
deferring the next highest priority task to a later point, and
wherein states of a system are modified by the suspension instance.

### Claim 6 (depends on 3)

The method of claim 3, wherein the balancing the currently running task comprises:
determining a deferred operation to be resumed in the invoked scheduling instance; and
performing the deferred operation in the invoked scheduling instance.

### Claim 7 (depends on 1)

The method of claim 1, wherein signaling between the first core and the second core for notifying events is carried out by activating interrupts invoked by software, and
wherein the method further comprises receiving the interrupt and determining an incoming task to be a high priority task during a first sub-critical section.

### Claim 8 (depends on 7)

The method of claim 7, further comprising storing a context of a currently running task on the second core and restoring a context of the determined high priority task during a second sub-critical section.

### Claim 9 (depends on 1)

The method of claim 1, wherein each of the tasks has an associated priority, and
wherein each of the tasks assumes one state from among: ready, running and suspended states.

### Claim 10 (depends on 1)

The method of claim 1,
wherein the deferring the switching context instance at the second core comprises unblocking a first core to perform other tasks, and
wherein the scheduling instance comprises preemption instance responsible for running a number of tasks equal to the number of cores participating in symmetric multi-processing (SMP), the running tasks being chosen from among tasks having ready state based on highest priority.

### Claim 11

An apparatus for scheduling of tasks for an operating system on a multi-core system, the apparatus comprising:
a memory;
a multi-core processor comprising a plurality of cores; and
an operating system (OS) to execute on the multi-core processor,
wherein the OS comprises a modular scheduler,
wherein the modular scheduler is coupled to the multi-core processor and the memory and is configured to:
receive a system call for initiating a scheduling operation on a second core;
invoke a scheduling instance to the second core, wherein the scheduling instance notifies the scheduling operation based on a priority of the tasks; and
defer a switching context instance at the second core, and
execute the deferred switching context instance when an interrupt is received by the second core.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the modular scheduler is further configured to:
execute at least one other system call on at least one core, and
wherein the execute the deferred switching context comprises execute the deferred switching context instance by determining an imbalance in the at least one core when the interrupt is received by the second core.

### Claim 13 (depends on 11)

The apparatus of claim 11, wherein the scheduling instance is invoked by sending the interrupt, and
wherein the scheduling operation comprises executing an incoming high priority task on the second core.

### Claim 14 (depends on 11)

The apparatus of claim 11, wherein the scheduling instance comprises at least one of:
preempting a currently running task, wherein the currently running task is running on the second core;
suspending the currently running task; and
balancing the currently running task.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the preempting the currently running task comprises:
determining a preemption condition by tracking a priority of the currently running task on the second core and a plurality of tasks which are in a ready state;
determining whether the preemption of the currently running task on the second core needs to be carried out successively in the scheduling instance or to be deferred; and
performing one of:
saving a context of a task to be preempted and restoring a context of a task to be executed when the preemption needs to be carried out successively in the scheduling instance, wherein the task to be preempted is the currently running task on the second core and the task to be executed is a task having a higher priority than the currently running task on the second core, and
performing a system state handling and signaling when the preemption is to be deferred.

### Claim 16 (depends on 14)

The apparatus of claim 14, wherein the suspending the currently running task comprises:
determining that the currently running task is to be suspended;
saving a context of the currently running task and suspending the currently running task;
determining a next highest priority task to be scheduled into running state; and
performing one of:
scheduling the next highest priority task successively in the suspension instance, and
deferring the next highest priority task to a later point, and
wherein states of a system are modified by the suspension instance.

### Claim 17 (depends on 14)

The apparatus of claim 14, wherein the balancing the currently running task comprises:
determining a deferred operation to be resumed in the invoked scheduling instance; and
performing the deferred operation in the invoked scheduling instance.

### Claim 18 (depends on 11)

The apparatus of claim 11, wherein signaling between the first core and the second core for notifying events is carried out by activating interrupts invoked by software, and
wherein the modular scheduler is configured to receive the interrupt and determine an incoming task to be a high priority task during a first sub-critical section.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the modular scheduler is further configured to store a context of a currently running task on the second core and restore a context of the determined high priority task during a second sub-critical section.

### Claim 20 (depends on 11)

The apparatus of claim 11, wherein each of the tasks has an associated priority,
wherein each of the tasks assumes one state from among: ready, running and suspended states,
wherein the defer the switching context instance at the second core comprises unblocking a first core to perform other tasks, and
wherein the scheduling instance comprises a preemption instance responsible for running a number of tasks equal to the number of cores participating in symmetric multi-processing (SMP), the running tasks being chosen from among tasks having ready state based on highest priority.
