svn commit: r296309 - projects/vnet/sys/netinet

Bjoern A. Zeeb bz at FreeBSD.org
Wed Mar 2 10:23:51 UTC 2016


Author: bz
Date: Wed Mar  2 10:23:50 2016
New Revision: 296309
URL: https://svnweb.freebsd.org/changeset/base/296309

Log:
  While there is no dependency interaction, stopping the timer before
  freeing the rest of the resources seems more natural and avoids it
  being scheduled an extra time when it is no longer needed.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/vnet/sys/netinet/tcp_syncache.c

Modified: projects/vnet/sys/netinet/tcp_syncache.c
==============================================================================
--- projects/vnet/sys/netinet/tcp_syncache.c	Wed Mar  2 09:54:58 2016	(r296308)
+++ projects/vnet/sys/netinet/tcp_syncache.c	Wed Mar  2 10:23:50 2016	(r296309)
@@ -281,6 +281,12 @@ syncache_destroy(void)
 	struct syncache *sc, *nsc;
 	int i;
 
+	/*
+	 * Stop the re-seed timer before freeing resources.  Not need to
+	 * possibly schedule it another time.
+	 */
+	callout_drain(&V_tcp_syncache.secret.reseed);
+
 	/* Cleanup hash buckets: stop timers, free entries, destroy locks. */
 	for (i = 0; i < V_tcp_syncache.hashsize; i++) {
 
@@ -304,8 +310,6 @@ syncache_destroy(void)
 	/* Free the allocated global resources. */
 	uma_zdestroy(V_tcp_syncache.zone);
 	free(V_tcp_syncache.hashbase, M_SYNCACHE);
-
-	callout_drain(&V_tcp_syncache.secret.reseed);
 }
 #endif
 


More information about the svn-src-projects mailing list