HomeFreeBSD

MFC r352658,352677,352713,352728: Fix/improve interrupt threads scheduling.

Description

MFC r352658,352677,352713,352728: 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.

Details

Provenance
mavAuthored on
Parents
rS356274: Some minor tweaks to arch(7).
Branches
Unknown
Tags
Unknown