Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Mar 2020 14:23:08 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r359437 - head/sys/dev/hwpmc
Message-ID:  <202003301423.02UEN8CH060045@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Mar 30 14:23:08 2020
New Revision: 359437
URL: https://svnweb.freebsd.org/changeset/base/359437

Log:
  Fix accounting of hwpmc's thread descriptor freelist.
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_mod.c	Mon Mar 30 14:22:52 2020	(r359436)
+++ head/sys/dev/hwpmc/hwpmc_mod.c	Mon Mar 30 14:23:08 2020	(r359437)
@@ -2428,12 +2428,13 @@ pmc_thread_descriptor_pool_free_task(void *arg __unuse
 	int delta;
 
 	LIST_INIT(&tmplist);
+
 	/* Determine what changes, if any, we need to make. */
 	mtx_lock_spin(&pmc_threadfreelist_mtx);
 	delta = pmc_threadfreelist_entries - pmc_threadfreelist_max;
-	while (delta > 0 &&
-		   (pt = LIST_FIRST(&pmc_threadfreelist)) != NULL) {
+	while (delta > 0 && (pt = LIST_FIRST(&pmc_threadfreelist)) != NULL) {
 		delta--;
+		pmc_threadfreelist_entries--;
 		LIST_REMOVE(pt, pt_next);
 		LIST_INSERT_HEAD(&tmplist, pt, pt_next);
 	}



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