drm/linux: Avoid contention in spinlock_irq routines
commitaee35aba1cffe329254921c892c174654ccb4f29
authorFrançois Tigeot <ftigeot@wolfpond.org>
Sun, 10 Jul 2016 11:40:37 +0000 (10 13:40 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Sun, 10 Jul 2016 11:46:32 +0000 (10 13:46 +0200)
tree88d93e23ded6acafe8d21d965609e3afc7d9b849
parente674353b80e9b15b0374d5154579755e53754184
drm/linux: Avoid contention in spinlock_irq routines

* Call crit_enter() first and lockmgr() later

* This helps to avoid unnecessary contention on the same cpu if a
  regular kernel thread holding the lockmgr lock is preempted by
  an interrupt thread which would like to acquire the same lock

* By putting the lockmgr() call in the critical section, we avoid the
  situation where the preempting interrupt routine tries to lock,
  races the main thread lock, and forces an extra two thread switches

Suggested-by: sephe@
Reviewed-by: dillon@ and sephe@
sys/dev/drm/include/linux/spinlock.h