HomeFreeBSD

Fix/improve interrupt threads scheduling.

Description

Fix/improve interrupt threads scheduling.

Doing some tests with very high interrupt rates I've noticed that one of
conditions I added in r232207 to make interrupt threads in most cases
run on local CPU never worked as expected (worked only if previous time
it was executed on some other CPU, that is quite opposite). It caused
additional CPU usage to run full CPU search and could schedule interrupt
threads to some other CPU.

This patch removes that code and instead reuses existing non-interrupt
code path with some tweaks for interrupt case:

  • On SMT systems, if current thread is idle, don't look on other threads.

Even if they are busy, it may take more time to do fill search and bounce
the interrupt thread to other core then execute it locally, even sharing
CPU resources. It is other threads should migrate, not bound interrupts.

  • Try hard to keep interrupt threads within LLC of their original CPU.

This improves scheduling cost and supposedly cache and memory locality.

On a test system with 72 threads doing 2.2M IOPS to NVMe this saves few
percents of CPU time while adding few percents to IOPS.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

Details

Provenance
mavAuthored on Sep 24 2019, 8:01 PM
Parents
rG35c7bb340788: This commit adds BBR (Bottleneck Bandwidth and RTT) congestion control. This
Branches
Unknown
Tags
Unknown