svn commit: r356429 - stable/12/sys/dev/ioat

Alexander Motin mav at FreeBSD.org
Tue Jan 7 00:54:24 UTC 2020


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

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/12/sys/dev/ioat/ioat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ioat/ioat.c
==============================================================================
--- stable/12/sys/dev/ioat/ioat.c	Mon Jan  6 21:23:14 2020	(r356428)
+++ stable/12/sys/dev/ioat/ioat.c	Tue Jan  7 00:54:23 2020	(r356429)
@@ -788,7 +788,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


More information about the svn-src-stable-12 mailing list