Documentation
¶
Overview ¶
Package affinity decides where a backend's workers run.
It is shared rather than per-backend because the two things that decide the answer are not specific to one: the memory node the card is attached to, and the cache complex a worker's doorbell writes travel from. The measurement below was taken on mlx5 Direct Verbs and applies unchanged to any backend whose workers ring doorbells through the same write-combining pages, which includes DPDK's mlx5 poll-mode driver.
A backend names itself in any error it passes on; nothing here does, so the same message reads correctly whichever backend produced it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Placement ¶
type Placement struct {
// contains filtered or unexported fields
}
placement is the order in which processors are handed to workers, and the record of which ones have been handed out.
func New ¶
New works out where a device's workers should run. want, when not empty, is the caller's own list and is used in the order given.
It returns nil, nil when the machine's topology yields nothing usable, which means "leave the workers where the scheduler puts them" rather than an error.
func (*Placement) Pin ¶
Pin puts the calling goroutine on a processor of its own and reports which.
A goroutine that drives several queues asks once per queue; the second and later calls find the thread already placed and leave it where it is, which is what makes "one worker, four queues" work without the queues fighting over where the worker runs.