IP Library Granted Patent US 11,971,830
Granted Patent B2
US 11,971,830 · App. 17/701,568 · Granted Apr 30, 2024

Efficient queue access for user-space packet processing

Inventor: Michael Tsirkin (Haifa, IL)
Assignee: Red Hat, Inc.
G06F13/1668G06F13/20
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,971,830
App. No.
17/701,568
Granted
Apr 30, 2024
Kind
B2
Abstract

An example method may include determining whether a preemption flag associated with a first input/output (I/O) handling thread is equal to a first value indicating that preemption of the first I/O queue handling thread is forthcoming, wherein the first I/O queue handling thread is executing on a first processor, the first I/O queue handling thread is associated with a first set of one or more queue identifiers, and each queue identifier identifies a queue being handled by the first I/O queue handling thread, and, responsive to determining that the preemption flag is equal to the first value, transferring the first set of one or more queue identifiers to a second I/O queue handling thread executing on a second processor. Transferring the first set of queue identifiers may include removing the one or more queue identifiers from the first set.

Claims (37)

1. A system comprising:

a memory device comprising a group of memory units; and

a processing device, operatively coupled to the memory device, to perform operations comprising:

determining whether a preemption flag associated with a first input/output (I/O) queue handling thread is equal to a first value indicating that preemption of the first I/O queue handling thread is forthcoming, wherein the first I/O queue handling thread is executing on a first processor, wherein the first I/O queue handling thread is associated with a first set of one or more queue identifiers, and wherein each queue identifier of the first set of one or more queue identifiers identifies a queue being handled by the first I/O queue handling thread; and

responsive to determining that the preemption flag is equal to the first value, transferring the first set of one or more queue identifiers to a second I/O queue handling thread executing on a second processor, wherein the first set of one or more queue identifiers is transferred to the second I/O queue handling thread via shared memory accessible to the first I/O queue handling thread and to the second I/O queue handling thread.

2. The system of claim 1 , wherein determining whether the preemption flag associated with the first I/O queue handling thread is equal to the first value is performed prior to de-queueing a packet from a queue identified by a queue identifier in the first set of one or more queue identifiers.

3. The system of claim 1 , wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises adding the one or more queue identifiers to a second set of queue identifiers that are associated with the second I/O queue handling thread.

4. The system of claim 1 , wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises removing the one or more queue identifiers from the first set of queue identifiers being handled by the first I/O queue handling thread.

5. The system of claim 1 , wherein a queue mapping data structure stored in a shared memory includes one or more queue-thread association entries, each queue-thread association entries associates a particular queue identifier with particular I/O queue handling thread, and wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises:

identifying each queue-thread association entry that associates a specified queue identifier with the first I/O queue handling thread; and

updating each identified queue-thread association to associate the specified queue identifier with the second I/O queue handling thread.

6. The system of claim 1 , the operations further comprising:

responsive to determining that the preemption flag is equal to a second value indicating that preemption of the first I/O queue handling thread is not forthcoming, de-queueing one or more packets from at least one queue identified by at least one of the queue identifiers; and

processing the one or more dequeued packets.

7. The system of claim 1 , the operations further comprising:

determining that a list of threads to be run on the first processor by an operating system has changed; and

responsive to determining that the list of threads has changed, sending a notification to a manager thread, wherein the notification instructs the manager thread to determine whether preemption of the first I/O queue handling thread is forthcoming.

8. A non-transitory machine-readable storage medium storing instructions which, when executed, cause a computer system to perform operations comprising:

determining whether a preemption flag associated with a first input/output (I/O) queue handling thread is equal to a first value indicating that preemption of the first I/O queue handling thread is forthcoming, wherein the first I/O queue handling thread is executing on a first processor, wherein the first I/O queue handling thread is associated with a first set of one or more queue identifiers, and wherein each queue identifier of the first set of one or more queue identifiers identifies a queue being handled by the first I/O queue handling thread; and

responsive to determining that the preemption flag is equal to the first value, transferring the first set of one or more queue identifiers to a second I/O queue handling thread executing on a second processor, wherein the first set of one or more queue identifiers is transferred to the second I/O queue handling thread via shared memory accessible to the first I/O queue handling thread and to the second I/O queue handling thread.

9. The non-transitory machine-readable storage medium of claim 8 , wherein determining whether the preemption flag associated with the first I/O queue handling thread is equal to the first value is performed prior to de-queueing a packet from a queue identified by a queue identifier in the first set of one or more queue identifiers.

10. The non-transitory machine-readable storage medium of claim 8 , wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises adding the one or more queue identifiers to a second set of queue identifiers that are associated with the second I/O queue handling thread.

11. The non-transitory machine-readable storage medium of claim 8 , wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises removing the one or more queue identifiers from the first set of queue identifiers being handled by the first I/O queue handling thread.

12. The non-transitory machine-readable storage medium of claim 8 , wherein a queue mapping data structure stored in a shared memory includes one or more queue-thread association entries, each queue-thread association entries associates a particular queue identifier with particular I/O queue handling thread, and wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises:

identifying each queue-thread association entry that associates a specified queue identifier with the first I/O queue handling thread; and

updating each identified queue-thread association to associate the specified queue identifier with the second I/O queue handling thread.

13. The non-transitory machine-readable storage medium of claim 8 , the operations further comprising:

responsive to determining that the preemption flag is equal to a second value indicating that preemption of the first I/O queue handling thread is not forthcoming, de-queueing one or more packets from at least one queue identified by at least one of the queue identifiers; and

processing the one or more dequeued packets.

14. The non-transitory machine-readable storage medium of claim 8 , the operations further comprising:

determining that a list of threads to be run on the first processor by an operating system has changed; and

responsive to determining that the list of threads has changed, sending a notification to a manager thread, wherein the notification instructs the manager thread to determine whether preemption of the first I/O queue handling thread is forthcoming.

15. A method comprising:

determining whether a preemption flag associated with a first input/output (I/O) queue handling thread is equal to a first value indicating that preemption of the first I/O queue handling thread is forthcoming, wherein the first I/O queue handling thread is executing on a first processor, wherein the first I/O queue handling thread is associated with a first set of one or more queue identifiers, and wherein each queue identifier of the first set of one or more queue identifiers identifies a queue being handled by the first I/O queue handling thread; and

responsive to determining that the preemption flag is equal to the first value, transferring the first set of one or more queue identifiers to a second I/O queue handling thread executing on a second processor, wherein the first set of one ore more queue identifiers is transferred to the second I/O queue handling thread via shared memory accessible to the first I/O queue handling thread and to the second I/O queue handling thread.

16. The method of claim 15 , wherein determining whether the preemption flag associated with the first I/O queue handling thread is equal to the first value is performed prior to de-queueing a packet from a queue identified by a queue identifier in the first set of one or more queue identifiers.

17. The method of claim 15 , wherein transferring the first set of one or more queue identifiers to the second I/O queue handling thread comprises adding the one or more queue identifiers to a second set of queue identifiers that are associated with the second I/O queue handling thread.

Assignments (2)
CHANGE OF NAME Recorded Mar 3, 2026
From: RED HAT, INC.
To: RED HAT, LLC
Reel/Frame 074913/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 26, 2022
From: TSIRKIN, MICHAEL
To: RED HAT, INC.
Reel/Frame 061215/0085 →