Author: bz
Date: Sat Apr  9 10:51:07 2016
New Revision: 297736
URL: https://svnweb.freebsd.org/changeset/base/297736

Log:
  Mfp: r296309
  
  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.
  
  Reviewed by:  gnn, emaste
  MFC after:    2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D5733

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c     Sat Apr  9 10:44:57 2016        
(r297735)
+++ head/sys/netinet/tcp_syncache.c     Sat Apr  9 10:51:07 2016        
(r297736)
@@ -281,6 +281,12 @@ syncache_destroy(void)
        struct syncache *sc, *nsc;
        int i;
 
+       /*
+        * Stop the re-seed timer before freeing resources.  No 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
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to