IP Library Granted Patent US 11,314,566
Granted Patent B1
US 11,314,566 · App. 16/563,556 · Granted Apr 26, 2022

Inter-process communication for microkernel operating system

Inventors: Christoph Klee (Snoqualmie, WA); Bernhard Poess (Redmond, WA); Sumit Kamath (Kirkland, WA)
Assignee: Facebook Technologies, LLC.
G06F9/545G06F9/461G06F9/542G06F9/544
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,314,566
App. No.
16/563,556
Granted
Apr 26, 2022
Kind
B1
Abstract

In one embodiment, a method includes creating, by a computing device, an inter process communication (IPC) channel for communication from a producer process to a consumer process. The IPC channel includes a message buffer mapped to a first virtual address space of a kernel of an operating system and to a second virtual address space of the consumer process in a user space of the operating system. A sender handle for the message buffer is sent to the producer process. The kernel receives a request, which includes the sender handle, to send a message from the producer process to the consumer process through the IPC channel. Responsive to a determination that the request is permitted, the kernel writes the message to the message buffer using the sender handle, such that message written in the message buffer is accessible to the consumer process through the second address space.

Claims (64)

1. A method comprising, by a computing device:

creating an inter process communication (IPC) channel for communication from a producer process to a consumer process, the IPC channel comprising:

a message buffer mapped to a first virtual address space of a kernel of an operating system executed by the computing device and to a second virtual address space of the consumer process in a user space of the operating system, wherein the message buffer comprises a plurality of segments corresponding to predefined memory blocks of the message buffer and an ownership array indicating which process has permission to modify each segment of the plurality of segments;

sending a sender handle for the message buffer to the producer process;

receiving, by the kernel, a request to send a message from the producer process to the consumer process through the IPC channel, the request comprising a received sender handle;

determining, based on a determination that the received sender handle is the same as the sender handle for the message buffer, that the request is permitted;

responsive to the determination that the request is permitted, writing, by the kernel, the message to a segment of the message buffer using the sender handle, wherein the message written in the segment of the message buffer is accessible to the consumer process through the second virtual address space;

after writing the message to the segment of the message buffer, updating ownership of the segment of the message buffer in the ownership array to indicate that the segment is owned by the consumer process, such that the segment is not overwritten until the consumer consumes the message;

consuming, by the consumer process, the message written in the segment; and

after consuming, by the consumer process, the message written in the segment, updating ownership of the segment of the message buffer in the ownership array to indicate that the segment is available for writing a new message.

2. The method of claim 1 , further comprising, by the computing device:

determining whether the consumer process is active; and

responsive to a determination that the consumer process is not active, sending a wakeup notification to the consumer process.

3. The method of claim 1 , wherein the kernel has read and write access to the message buffer and the consumer process has read-only access to the message buffer.

4. The method of claim 1 , further comprising consuming the message by the consumer process without issuing a system call.

5. The method of claim 1 , wherein the message buffer is a circular buffer.

6. The method of claim 1 , wherein the IPC channel further comprises a producer counter for identifying a next available segment for producing a next message; and

wherein the method further comprises, prior to writing the message to the message buffer, incrementing a value of the producer counter.

7. The method of claim 1 , wherein the message buffer further comprises:

a consumer counter for identifying a next index at which a subsequent message may be consumed; and

a state buffer indicating a consumption state of each message stored in the message buffer.

8. One or more computer-readable non-transitory storage media embodying software that is operable when executed to:

create an inter process communication (IPC) channel for communication from a producer process to a consumer process, the IPC channel comprising:

a message buffer mapped to a first virtual address space of a kernel of an operating system executed by a device and to a second virtual address space of the consumer process in a user space of the operating system, wherein the message buffer comprises a plurality of segments corresponding to predefined memory blocks of the message buffer and an ownership array indicating which process has permission to modify each segment of the plurality of segments;

send a sender handle for the message buffer to the producer process;

receive, by the kernel, a request to send a message from the producer process to the consumer process through the IPC channel, the request comprising a received sender handle;

determine, based on a determination that the received sender handle is the same as the sender handle for the message buffer, that the request is permitted

responsive to the determination that the request is permitted, write, by the kernel, the message to a segment of the message buffer using the sender handle, wherein the message written in the segment of the message buffer is accessible to the consumer process through the second virtual address space;

after writing the message to the segment of the message buffer, update ownership of the segment of the message buffer in the ownership array to indicate that the segment is owned by the consumer process, such that the segment is not overwritten until the consumer consumes the message;

consume, by the consumer process, the message written in the segment; and

after the consumer process consumes the message written in the segment, update ownership of the segment of the message buffer in the ownership array to indicate that the segment is available for writing a new message.

9. The media of claim 8 , wherein the software is further operable when executed to:

determine whether the consumer process is active; and

responsive to a determination that the consumer process is not active, send a wakeup notification to the consumer process.

10. The media of claim 8 , wherein the kernel has read and write access to the message buffer and the consumer process has read-only access to the message buffer.

11. The media of claim 8 , wherein the software is further operable when executed to consume the message by the consumer process without issuing a system call.

12. The media of claim 8 , wherein the message buffer is a circular buffer.

13. The media of claim 8 , wherein:

the IPC channel further comprises a producer counter for counting a number of messages written to the message buffer; and

the software is further operable when executed to, prior to writing the message to the message buffer, increment a value of the producer counter.

14. The media of claim 8 , wherein the message buffer further comprises:

a consumer counter for counting a number of messages to be consumed by the consumer process; and

a state buffer indicating a consumption state of each message stored in the message buffer.

15. 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 or more of the processors to cause the system to:

create an inter process communication (IPC) channel for communication from a producer process to a consumer process, the IPC channel comprising:

a message buffer mapped to a first virtual address space of a kernel of an operating system executed by a device and to a second virtual address space of the consumer process in a user space of the operating system, wherein the message buffer comprises a plurality of segments corresponding to predefined memory blocks of the message buffer and an ownership array indicating which process has permission to modify each segment of the plurality of segments;

send a sender handle for the message buffer to the producer process;

receive, by the kernel, a request to send a message from the producer process to the consumer process through the IPC channel, the request comprising a received sender handle;

determine, based on a determination that the received sender handle is the same as the sender handle for the message buffer, that the request is permitted

responsive to the determination that the request is permitted, write, by the kernel, the message to a segment of the message buffer using the sender handle, wherein the message written in the segment of the message buffer is accessible to the consumer process through the second virtual address space;

after writing the message to the segment of the message buffer, update ownership of the segment of the message buffer in the ownership array to indicate that the segment is owned by the consumer process, such that the segment is not overwritten until the consumer consumes the message;

consume, by the consumer process, the message written in the segment; and

after the consumer process consumes the message written in the segment, update ownership of the segment of the message buffer in the ownership array to indicate that the segment is available for writing a new message.

16. The system of claim 15 , wherein the processors are further operable when executing the instructions to:

determine whether the consumer process is active; and

responsive to a determination that the consumer process is not active, send a wakeup notification to the consumer process.

17. The system of claim 15 , wherein the kernel has read and write access to the message buffer and the consumer process has read-only access to the message buffer.

18. The system of claim 15 , wherein the processors are further operable when executing the instructions to consume the message by the consumer process without issuing a system call.

19. The system of claim 15 , wherein the message buffer is a circular buffer.

20. The system of claim 15 , wherein:

the IPC channel further comprises a producer counter for counting a number of messages written to the message buffer; and

wherein the processors are further operable when executing the instructions to, after writing the message to the message buffer, increment a value of the producer counter.

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 10, 2019
From: KLEE, CHRISTOPH; POESS, BERNHARD; KAMATH, SUMIT
To: FACEBOOK TECHNOLOGIES, LLC
Reel/Frame 050325/0996 →