Module Name:    src
Committed By:   thorpej
Date:           Sat Apr  3 14:56:14 UTC 2021

Modified Files:
        src/sys/arch/alpha/alpha: pmap.c
        src/sys/arch/alpha/include: lock.h
        src/sys/kern: kern_mutex.c

Log Message:
Fix an IPI deadlock scenario that resulted in a TLB shootdown timeout
panic reported by John Klos on port-alpha:

- pmap_tlb_shootnow(): If we acquire a pmap's activation lock, we will
  have raised the IPL on the current CPU to IPL_SCHED until we drop
  the tlb_lock (due to how nested spin mutexes work).  As such, when
  we release the activation lock, forcibly lower our IPL back to IPL_VM
  so that we can receive and process IPIs while waiting for other CPUs
  to process the shootdowns.
- mutex_vector_enter(): Invoke SPINLOCK_SPIN_HOOK while spinning to acquire
  a spin mutex.  This is a nop on most platforms, but it's important on
  the Alpha.  Without this, IPIs (and thus TLB shootdowns) cannot be
  processed if trying to acquire an IPL_SCHED spin mutex such as those
  used by the scheduler.

...and while we're poking around in here:

- Rework the Alpha SPINLOCK_SPIN_HOOK to only check curcpu()->ci_ipis
  if the current CPU's IPL is >= IPL_CLOCK (thus ensuring that preemption
  is disabled and thus guaranteeing that curcpu() is stable).  (Alpha does
  not yet support kernel preemption, but this is now one less thing that
  would need to be fixed.)


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/include/lock.h
cvs rdiff -u -r1.96 -r1.97 src/sys/kern/kern_mutex.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to