kernel - Deal with lost IPIs (VM related)
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 6 Sep 2016 00:11:05 +0000 (17:11 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 12 Sep 2016 01:09:24 +0000 (18:09 -0700)
commit46b5c9082ad5c4c7de03a86e8cda85240effe576
treeb5ebd868dd39bc2549559356956a0267775d9ad2
parentec953495f822470bff6252f14177cfbb1c3798c9
kernel - Deal with lost IPIs (VM related)

* Some (all?) VMs appear to be able to lose IPIs.  Hopefully the same can't
  be said for device interrupts!  Add some recovery code for lost Xinvltlb
  IPIs for now.

  For synchronizing invalidations we use the TSC and run a recovery attempt
  after 1/16 second, and every 1 second there-after, if an Xinvltlb is not
  responded to (smp_invltlb() and smp_invlpg()).  The IPI will be re-issued.

* Some basic testing shows that a VM can stall out a cpu thread for an
  indefinite period of time, potentially causing the above watchdog to
  trigger.  Even so it should not have required re-issuing the IPI, but
  it seems it does, so the VM appears to be losing the IPI(!) when a cpu
  thread stalls out on the host!  At least with the VM we tested under,
  type unknown.

* IPIQ IPIs currently do not have any specific recovery but I think each
  cpu will poll for IPIQs slowly in the idle thread, so they might
  automatically recover anyway.

Reported-by: zach
sys/platform/pc64/x86_64/mp_machdep.c
sys/platform/pc64/x86_64/pmap_inval.c