# US 2021/0286628 A1 · Operating System With A Single Kernel Stack Per Processor

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

- Number: US 2021/0286628 A1
- Document ID: US20210286628A1
- Status: Published application
- Kind: A1
- Application number: 17/307,374
- Filed: 2021-05-04
- Published: 2021-09-16
- Earliest claimed: 2019-07-31
- Assignees: Facebook Technologies, LLC
- Applicants: Facebook Technologies, LLC
- Inventors: Christoph Klee; Bernhard Poess
- Web page: https://patentgrep.com/patent/US20210286628A1

## CPC

- G06F 9/4406: {Loading of operating system}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/4812: {by interrupt, e.g. masked}
- G06F 9/5027: {the resource being a machine, e.g. CPUs, Servers, Terminals}
- G06F 9/545: {where tasks reside in different layers, e.g. user- and kernel-space}
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F 2212/1021: Hit rate improvement
- G06F 2212/1028: Power efficiency
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

In one embodiment, a method includes storing thread state information associated with the first user-mode thread into a memory space associated with the first user-mode thread when executing in kernel space in response to a first system call by a first-user mode thread, executing first operations corresponding to the first system call on a processor, where data associated with executing the first operations are stored on a kernel stack associated with the processor, determining to pause the execution of the first operations, enqueuing a workload on a schedule queue for resuming execution of the first operations in a future, where the workload comprises data associated with executing a remainder of the first operations, and executing second operations corresponding to a second system call from a second user-mode thread on the processor, where data associated with executing the second operations are stored on the kernel stack associated with the processor.

## Claims

### Claim at position 1

1-20. (canceled)

### Claim 21

A method comprising, by a kernel-mode thread of an operating system of a computing device:
executing first operations corresponding to a first system call, wherein data associated with executing the first operations are stored on a kernel stack associated with a processor;
determining to pause the execution of the first operations;
enqueuing a workload on a schedule queue for resuming the execution of the first operations in a future, wherein the workload comprises data associated with executing a remainder of the first operations; and
executing second operations corresponding to a second system call, wherein data associated with executing the second operations are stored on the kernel stack associated with the processor.

### Claim 22 (depends on 21)

The method of claim 21, wherein a processor of the computing device is associated with only one kernel-mode thread.

### Claim 23 (depends on 22)

The method of claim 22, wherein the first operations and the second operations are executed by the kernel-mode thread running on the processor.

### Claim 24 (depends on 21)

The method of claim 21, wherein determining to pause the execution of the first operations comprises calling a scheduler function, wherein the scheduler function makes a schedule decision among a plurality of workloads in the schedule queue.

### Claim 25 (depends on 24)

The method of claim 24, wherein the schedule decision is made based on one or more scheduling policies.

### Claim 26 (depends on 21)

The method of claim 21, wherein the operating system is a microkernel-based operating system, wherein user-mode threads in the operating system comprise user application threads and service-providing threads.

### Claim 27 (depends on 26)

The method of claim 26, wherein a first service-providing thread provides a particular service to one or more user-mode threads.

### Claim 28 (depends on 27)

The method of claim 27, wherein a request for the particular service from one of the one or more user-mode threads to the first service-providing thread is communicated through one of available Inter-Process Communication (IPC) mechanisms.

### Claim 29 (depends on 28)

The method of claim 28, wherein a result of the particular service from the first service-providing thread to the one of the one or more user-mode threads is communicated through one of the available IPC mechanisms or a shared memory.

### Claim 30 (depends on 26)

The method of claim 26, wherein the service-providing threads comprise device drivers.

### Claim 31 (depends on 26)

The method of claim 26, wherein the user application threads are implemented with an event-driven architecture.

### Claim 32 (depends on 21)

The method of claim 21, wherein the first system call is made by a first user-mode thread, wherein thread state information associated with the first user-mode thread is stored into a memory space associated with the first user-mode thread before the first operations are executed, and wherein the thread state information associated with the first user-mode thread is a snapshot of register values associated with the processor when the first user-mode thread makes the first system call.

### Claim 33 (depends on 32)

The method of claim 32, wherein the memory space associated with the first user-mode thread is a Thread-Local Storage (TLS) associated with the first user-mode thread or a Thread Control Block (TCB) associated with the first user-mode thread.

### Claim 34 (depends on 21)

The method of claim 21, wherein the second system call is made by a second user-mode thread, and wherein the second operations comprise returning to the second user-mode thread.

### Claim 35 (depends on 34)

The method of claim 34, wherein returning to the second user-mode thread comprises:
retrieving thread state information associated with the second user-mode thread from a memory space associated with the second user-mode thread;
returning results of the second operations to the second system call; and
restoring registers of the processor with the retrieved thread state information.

### Claim 36

One or more computer-readable non-transitory storage media embodying software that is operable by a kernel-mode thread of an operating system of a computing device when executed to:
execute first operations corresponding to a first system call, wherein data associated with executing the first operations are stored on a kernel stack associated with a processor;
determine to pause the execution of the first operations;
enqueue a workload on a schedule queue for resuming the execution of the first operations in a future, wherein the workload comprises data associated with executing a remainder of the first operations; and
execute second operations corresponding to a second system call, wherein data associated with executing the second operations are stored on the kernel stack associated with the processor.

### Claim 37 (depends on 36)

The media of claim 36, wherein a processor of the computing device is associated with only one kernel-mode thread.

### Claim 38 (depends on 37)

The media of claim 37, wherein the first operations and the second operations are executed by the kernel-mode thread running on the processor.

### Claim 39 (depends on 36)

The media of claim 36, wherein determining to pause the execution of the first operations comprises calling a scheduler function, wherein the scheduler function makes a schedule decision among a plurality of workloads in the schedule queue.

### Claim 40

A computing device comprising:
one or more processors; and
one or more computer-readable non-transitory storage media coupled to one or more of the one or more processors and comprising instructions operable when executed by one of the one or more processors to cause a kernel-mode thread of an operating system of the computing device to:
execute first operations corresponding to a first system call, wherein data associated with executing the first operations are stored on a kernel stack associated with a processor among the one or more processors;
determine to pause the execution of the first operations;
enqueue a workload on a schedule queue for resuming the execution of the first operations in a future, wherein the workload comprises data associated with executing a remainder of the first operations; and
execute second operations corresponding to a second system call, wherein data associated with executing the second operations are stored on the kernel stack associated with the processor.
