Author: mav
Date: Tue Jan  7 00:54:45 2020
New Revision: 356430
URL: https://svnweb.freebsd.org/changeset/base/356430

Log:
  MFC r356216: Don't spin on cleanup_lock if we are not interrupt.
  
  If somebody else holds that lock, it will likely do the work for us.
  If it won't, then we return here later and retry.
  
  Under heavy load it allows to avoid lock congestion between interrupt and
  polling threads.

Modified:
  stable/11/sys/dev/ioat/ioat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ioat/ioat.c
==============================================================================
--- stable/11/sys/dev/ioat/ioat.c       Tue Jan  7 00:54:23 2020        
(r356429)
+++ stable/11/sys/dev/ioat/ioat.c       Tue Jan  7 00:54:45 2020        
(r356430)
@@ -682,7 +682,12 @@ ioat_process_events(struct ioat_softc *ioat, boolean_t
        uint32_t completed, chanerr;
        int error;
 
-       mtx_lock(&ioat->cleanup_lock);
+       if (intr) {
+               mtx_lock(&ioat->cleanup_lock);
+       } else {
+               if (!mtx_trylock(&ioat->cleanup_lock))
+                       return;
+       }
 
        /*
         * Don't run while the hardware is being reset.  Reset is responsible
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to