Workqueues

Onload User Guide (UG1586)

Document ID
UG1586
Release Date
2023-07-31
Revision
1.2 English

An Onloaded application will create two shared workqueues and one per-stack workqueue. The implementation of the workqueue differs between Linux kernels - and so does the method used to affinitize workqueues.

On more recent Linux kernels (3.10+) the Onload work queues will be initially affinitized to the node on which they are created. Therefore if the driver load is affinitized and the Onloaded application affinitized to the correct node, Onload stacks will be created on the correct node and there will be no further work required.

Specifying a cpumask via sysfs for a workqueue is NOT recommended as this can break ordering requirements.

On older Linux kernels dedicated workqueue threads are created - and these can be affinitized using taskset or cpusets. Identify the two workqueues shared by all Onload stacks:

onload-wqueue
sfc_vi

Identify the per-stack workqueue which has a name in the format onload-wq<stack id> (for example onload-wq:1 for stack 1).

Use the onload_stackdump command to identify Onload stacks and the PID of the process that created the stack:

# onload_stackdump
#stack-id stack-name      pids
0         -               106913

Use the Linux pidof command to identify the PIDs for Onload workqueues:

# pidof onload-wq:0 sfc_vi onload-wqueue
106930 105409 105431

It is recommended that the shared workqueues are affinitized immediately after the driver is loaded and the per-stack queue immediately after stack creation.