Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2020 00:54:45 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r356430 - stable/11/sys/dev/ioat
Message-ID:  <202001070054.0070sjZN005279@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001070054.0070sjZN005279>