IP Library Granted Patent US 11,029,968
Granted Patent B1
US 11,029,968 · App. 16/528,221 · Granted Jun 8, 2021

Operating system with a single kernel stack per processor

Inventors: Christoph Klee (Snoqualmie, WA); Bernhard Poess (Redmond, WA)
Assignee: Facebook Technologies, LLC
G06F9/4406G06F9/5027
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 11,029,968
App. No.
16/528,221
Granted
Jun 8, 2021
Kind
B1
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 (40)

1. A method comprising, by a kernel-mode thread of an operating system of a computing device:

storing, in response to a first system call by a first-user mode thread, 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;

executing, on a processor of the computing device, first operations corresponding to the first system call, wherein 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 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, on the processor, second operations corresponding to a second system call from a second user-mode thread, wherein data associated with executing the second operations are stored on the kernel stack associated with the processor.

2. The method of claim 1 , 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.

3. The method of claim 1 , wherein the processor is associated with only one kernel-mode thread.

4. The method of claim 1 , wherein the memory space associated with the first user-mode thread is a Thread-Local Storage (TLS) associated with the first user-mode thread.

5. The method of claim 1 , wherein the memory space associated with the first user-mode thread is a Thread Control Block (TCB) associated with the first user-mode thread.

6. The method of claim 1 , 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.

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

8. The method of claim 1 , wherein the second operations comprise returning to the second user-mode thread.

9. The method of claim 8 , 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.

10. The method of claim 1 , 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.

11. The method of claim 10 , wherein a first service-providing thread provides a particular service to second threads, wherein the second threads comprise other service-providing threads or user application threads.

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

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

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

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

16. 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:

store, in response to a first system call by a first user-mode thread, 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;

execute, on a processor of the computing device, first operations corresponding to the first system call, wherein data associated with executing the first operations are stored on a kernel stack associated with the 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, on the processor, second operations corresponding to a second system call from a second user-mode thread, wherein data associated with executing the second operations are stored on the kernel stack associated with the processor.

17. The media of claim 16 , 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.

18. The media of claim 16 , wherein the processor is associated with only one kernel-mode thread.

19. The media of claim 16 , wherein the memory space associated with the first user-mode thread is a Thread-Local Storage (TLS) associated with the first user-mode thread.

20. A system comprising:

one or more processors; and

one or more computer-readable non-transitory storage media coupled to one or more of the processors and comprising instructions operable when executed by one of the processors to cause a kernel-mode thread of an operating system of the system to:

store, in response to a first system call by a first user-mode thread, 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;

execute, on a processor among the one or more processors, first operations corresponding to the first system call, wherein data associated with executing the first operations are stored on a kernel stack associated with the 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, on the processor, second operations corresponding to a second system call from a second user-mode thread, wherein data associated with executing the second operations are stored on the kernel stack associated with the processor.

Assignments (2)
CHANGE OF NAME Recorded Jul 6, 2022
From: FACEBOOK TECHNOLOGIES, LLC
To: META PLATFORMS TECHNOLOGIES, LLC
Reel/Frame 060591/0848 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2019
From: KLEE, CHRISTOPH; POESS, BERNHARD
To: FACEBOOK TECHNOLOGIES, LLC
Reel/Frame 050390/0440 →