From owner-svn-src-head@freebsd.org Mon Jan 30 15:20:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1FA9CC78C1; Mon, 30 Jan 2017 15:20:14 +0000 (UTC) (envelope-from avg@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 mx1.freebsd.org (Postfix) with ESMTPS id C1C7D7E2; Mon, 30 Jan 2017 15:20:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0UFKDjM023763; Mon, 30 Jan 2017 15:20:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0UFKDej023762; Mon, 30 Jan 2017 15:20:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701301520.v0UFKDej023762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 30 Jan 2017 15:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312991 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 15:20:15 -0000 Author: avg Date: Mon Jan 30 15:20:13 2017 New Revision: 312991 URL: https://svnweb.freebsd.org/changeset/base/312991 Log: put very expensive sanity checks of advisory locks under DIAGNOSTIC The checks have quadratic complexity over a number of advisory locks active for a file and that could be a lot. What's the worse is that the checks are done while holding ls_lock. That could lead to a long a very long backlog and performance degradation even if all requested locks are compatible (e.g. all shared locks). The checks used to be under INVARIANTS. Discussed with: kib MFC after: 2 weeks Sponsored by: Panzura Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Jan 30 14:34:04 2017 (r312990) +++ head/sys/kern/kern_lockf.c Mon Jan 30 15:20:13 2017 (r312991) @@ -689,7 +689,7 @@ retry_setlock: break; } -#ifdef INVARIANTS +#ifdef DIAGNOSTIC /* * Check for some can't happen stuff. In this case, the active * lock list becoming disordered or containing mutually @@ -917,7 +917,7 @@ lf_add_edge(struct lockf_entry *x, struc struct lockf_edge *e; int error; -#ifdef INVARIANTS +#ifdef DIAGNOSTIC LIST_FOREACH(e, &x->lf_outedges, le_outlink) KASSERT(e->le_to != y, ("adding lock edge twice")); #endif