From owner-svn-src-all@freebsd.org Tue Jan 7 00:54:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 272881DD046; Tue, 7 Jan 2020 00:54:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47sDRN0H72z4TLn; Tue, 7 Jan 2020 00:54:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04E5F1EEEB; Tue, 7 Jan 2020 00:54:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0070sN5A005204; Tue, 7 Jan 2020 00:54:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0070sNUu005203; Tue, 7 Jan 2020 00:54:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001070054.0070sNUu005203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 7 Jan 2020 00:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356429 - stable/12/sys/dev/ioat X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/ioat X-SVN-Commit-Revision: 356429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 00:54:24 -0000 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