Author: bz
Date: Thu Jun 23 11:55:15 2016
New Revision: 302140
URL: https://svnweb.freebsd.org/changeset/base/302140

Log:
  In VNET TCP teardown Do not sleep unconditionally but only if we
  have any TCP connections left.
  
  Submitted by:         zec
  Approved by:          re (hrs)
  MFC after:            13 days

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c Thu Jun 23 09:23:37 2016        (r302139)
+++ head/sys/netinet/tcp_subr.c Thu Jun 23 11:55:15 2016        (r302140)
@@ -739,10 +739,11 @@ tcp_destroy(void *unused __unused)
         * Sleep to let all tcpcb timers really disappear and cleanup.
         */
        do {
-               pause("tcpdes", hz/10);
                INP_LIST_RLOCK(&V_tcbinfo);
                n = V_tcbinfo.ipi_count;
                INP_LIST_RUNLOCK(&V_tcbinfo);
+               if (n != 0)
+                       pause("tcpdes", hz / 10);
        } while (n != 0);
        tcp_hc_destroy();
        syncache_destroy();
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to