Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2018 07:52:56 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332880 - head/sys/kern
Message-ID:  <201804230752.w3N7quS8026754@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Mon Apr 23 07:52:56 2018
New Revision: 332880
URL: https://svnweb.freebsd.org/changeset/base/332880

Log:
  lockf: perform wakeup onlly when there is anybody waiting
  
  Tested by:      pho

Modified:
  head/sys/kern/kern_lockf.c

Modified: head/sys/kern/kern_lockf.c
==============================================================================
--- head/sys/kern/kern_lockf.c	Mon Apr 23 07:52:10 2018	(r332879)
+++ head/sys/kern/kern_lockf.c	Mon Apr 23 07:52:56 2018	(r332880)
@@ -724,10 +724,11 @@ retry_setlock:
 	VI_LOCK(vp);
 
 	state->ls_threads--;
-	wakeup(state);
 	if (LIST_EMPTY(&state->ls_active) && state->ls_threads == 0) {
 		KASSERT(LIST_EMPTY(&state->ls_pending),
 		    ("freeable state with pending locks"));
+	} else {
+		wakeup(state);
 	}
 
 	VI_UNLOCK(vp);



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