HomeFreeBSD

Schedule fast taskqueue callouts on right CPU.

Description

Schedule fast taskqueue callouts on right CPU.

With fast taskqueues using direct callouts we can reduce number of
CPU wakeups by scheduling callout on current CPU if taskqueue calls
taskqueue_enqueue_timeout() on itself. The trick won't work for
regular taskqueues, since the callout thread will occupy the CPU.
It also may not work in case of multiple threads since we do not
know which thread will pick the task, and we do not want excessive
callout migrations. So we optimize only the other cases we can.

In practice this allows iichid(4) taskqueue to stay on CPU where
underlying ig4(4) interrupts are routed and to not kick CPU 0 with
timer interrupts on each sampling period (every 2nd/3rd sleep).

MFC after: 1 month

Details

Provenance
mavAuthored on Dec 27 2023, 3:30 AM
Parents
rGa8b70cf26030: netpfil: Use accessor functions and named constants for all tcphdr flags
Branches
Unknown
Tags
Unknown