]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- Give PIL_PREEMPT the lowest priority just above low/stray interrupts.
authorMarius Strobl <marius@FreeBSD.org>
Sat, 20 Oct 2012 12:07:48 +0000 (12:07 +0000)
committerMarius Strobl <marius@FreeBSD.org>
Sat, 20 Oct 2012 12:07:48 +0000 (12:07 +0000)
commit4cf9e21ed82252b492b68dd54663caec31f993ba
treeac74deb8fd06f31ccc90de3fe30901bfca581cd6
parent1490de00a8c80481e537eb82cb73c6cb99ce7876
- Give PIL_PREEMPT the lowest priority just above low/stray interrupts.
  The reason for this is that the SPARC v9 architecture allows nested
  interrupts of higher priority/level than that of the current interrupt
  to occur (and we can't just entirely bypass this model, also, at least
  for tick interrupts, this also wouldn't be wise). However, when a
  preemption interrupt interrupts another interrupt of lower priority,
  f.e. PIL_ITHREAD, and that one in turn is nested by a third interrupt,
  f.e. PIL_TICK, with SCHED_ULE the execution of interrupts higher than
  PIL_PREEMPT may be migrated to another CPU. In particular, tl1_ret(),
  which is responsible for restoring the state of the CPU prior to entry
  to the interrupt based on the (also migrated) trap frame, then is run
  on a CPU which actually didn't receive the interrupt in question,
  causing an inappropriate processor interrupt level to be "restored".
  In turn, this causes interrupts of the first level, i.e. PIL_ITHREAD
  in the above scenario, to be blocked on the target of the migration
  until the correct PIL happens to be restored again on that CPU again.
  Making PIL_PREEMPT the lowest real priority, this effectively prevents
  this scenario from happening, as preemption interrupts no longer can
  interrupt any other interrupt besides stray ones (which is no issue).
  Thanks to attilio@ and especially mav@ for helping me to understand
  this problem at the 201208DevSummit.
- Give PIL_STOP (which is also used for IPI_STOP_HARD, given that there's
  no real equivalent to NMIs on SPARC v9) the highest possible priority
  just below the hardwired PIL_TICK, so it has a chance to interrupt
  more things.

MFC after: 1 week
sys/sparc64/include/intr_machdep.h
sys/sparc64/sparc64/intr_machdep.c