HomeFreeBSD

MFC r352658, r352677, r352713:

Description

MFC r352658, r352677, r352713:
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

Committed
mavOct 24 2019, 7:11 PM
Parents
rS354031: MFC 350178: Improve the precision of bhyve's vPIT.
Branches
Unknown
Tags
Unknown