git: drm/linux: Avoid contention in spinlock_irq routines

Francois Tigeot ftigeot at crater.dragonflybsd.org
Sun Jul 10 04:47:45 PDT 2016


commit aee35aba1cffe329254921c892c174654ccb4f29
Author: François Tigeot <ftigeot at wolfpond.org>
Date:   Sun Jul 10 13:40:37 2016 +0200

    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@

Summary of changes:
 sys/dev/drm/include/linux/spinlock.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/aee35aba1cffe329254921c892c174654ccb4f29


-- 
DragonFly BSD source repository



More information about the Commits mailing list