Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2003 23:48:14 +0100
From:      Andre Oppermann <andre@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   Fix for 5.2-BETA lockup problems
Message-ID:  <3FC67F2E.EBF83B89@freebsd.org>

next in thread | raw e-mail | index | archive | help
Hello all,

I've found what probably is going wrong in tcp_hostcache.  The problem is me
cutting corners (what goes around comes around...) in tcp_hc_insert when the
bucket limit is reached.  I made the #if 0 too big and the bucket was not
removed from the tailqueue when we hit the bucket limit.  A couple of lines
later it is inserted again as head element which leads to an infinite loop
either when the next lookup on the same bucket row is done, or when the
the tcp_hc_purge function is run to timeout the entries.

Please try the attached patch which should fix it.

-- 
Andre


Index: tcp_hostcache.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_hostcache.c,v
retrieving revision 1.1
diff -u -p -r1.1 tcp_hostcache.c
--- tcp_hostcache.c     20 Nov 2003 20:07:38 -0000      1.1
+++ tcp_hostcache.c     27 Nov 2003 20:23:06 -0000
@@ -354,11 +354,11 @@ tcp_hc_insert(struct in_conninfo *inc)
                 * maybe we drop something that is still "in-use" but we can
                 * be "lossy".
                 */
-#if 0
                TAILQ_REMOVE(&hc_head->hch_bucket, hc_entry, rmx_q);
-               uma_zfree(tcp_hostcache.zone, hc_entry);
                tcp_hostcache.hashbase[hash].hch_length--;
                tcp_hostcache.cache_count--;
+#if 0
+               uma_zfree(tcp_hostcache.zone, hc_entry);
 #endif
                tcpstat.tcps_hc_bucketoverflow++;
        } else {



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