mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 21:16:52 +01:00
tun: Allow excluding CPUs from process threads at startup
Set tun.avoid_cpus to a list of logical CPUs to remove from the affinity of every thread of the process on Linux, before services start and reader CPUs are chosen. Later threads inherit the restricted mask; enumeration repeats so threads created meanwhile are covered. Inherited taskset and cgroup restrictions are kept. Keeping Nebula off the underlay NIC's receive IRQ CPUs and their SMT siblings is what this is for; the example configuration shows how to find them. Invalid IDs, a list that would leave a thread no CPU, and syscall failures fail startup. Configuration tests only validate. Other platforms log and ignore the setting. The exclusion is process-wide, including embedded use, and not reloadable. It is independent of thread pinning. New API: util.AvoidCPUs, next to the existing PinThreadToCPU and AllowedCPUs. Tests run in a child process and check existing and new threads, preserved inherited masks, validation without changes, and the unix.CPUSet bounds on 32- and 64-bit platforms. No isolated performance claim is made.
This commit is contained in:
1 parent
94372f4f51
commit
73d26dd87d
6 files changed
+248
No files matched your search
@@ -295,6 +295,14 @@ tun:
|
||||
# - 2
|
||||
# - 4
|
||||
|
||||
# Linux only. avoid_cpus removes these CPU IDs from the affinity of every thread of the process at startup,
|
||||
# embedding applications included; later threads inherit the remaining set. Applied before cpu_affinity and the
|
||||
# default pin selection, independent of pin_threads. Invalid IDs, or IDs that would leave no CPU, fail
|
||||
# startup. Not reloadable; ignored on other platforms. To keep Nebula off the underlay NIC's receive IRQ CPUs, find
|
||||
# them in /proc/interrupts and /proc/irq/<IRQ>/effective_affinity_list, add their SMT siblings from
|
||||
# /sys/devices/system/cpu/cpu<N>/topology/thread_siblings_list, and revisit the list when IRQ placement changes.
|
||||
#avoid_cpus: []
|
||||
|
||||
# Route based MTU overrides, you have known vpn ip paths that can support larger MTUs you can increase/decrease them here
|
||||
routes:
|
||||
#- mtu: 8800
|
||||
|
||||
Reference in new issue
Block a user