From owner-freebsd-net@FreeBSD.ORG Thu Jun 24 15:47:58 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B7A1065674 for ; Thu, 24 Jun 2010 15:47:58 +0000 (UTC) (envelope-from spawk@acm.poly.edu) Received: from acm.poly.edu (acm.poly.edu [128.238.9.200]) by mx1.freebsd.org (Postfix) with ESMTP id 413668FC15 for ; Thu, 24 Jun 2010 15:47:57 +0000 (UTC) Received: (qmail 31835 invoked from network); 24 Jun 2010 15:47:57 -0000 Received: from unknown (HELO ?10.0.0.174?) (spawk@128.238.64.31) by acm.poly.edu with AES256-SHA encrypted SMTP; 24 Jun 2010 15:47:57 -0000 Message-ID: <4C237E2C.3080103@acm.poly.edu> Date: Thu, 24 Jun 2010 11:47:56 -0400 From: Boris Kochergin User-Agent: Thunderbird 2.0.0.24 (X11/20100530) MIME-Version: 1.0 To: Sam Leffler References: <4A8C3557.20002@acm.poly.edu> <4AA03A41.1080200@acm.poly.edu> <4AB1A086.4090303@acm.poly.edu> <4AB1D7C2.5010403@freebsd.org> In-Reply-To: <4AB1D7C2.5010403@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, stef@memberwebs.com Subject: Re: kmem_map too small panics with Soekris/Atheros access point [ath rate control] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 15:47:58 -0000 Sam Leffler wrote: > Boris Kochergin wrote: > >> Stef Walter wrote: >> >>> Boris Kochergin wrote: >>> >>> >> I, too, recall the days when you had multiple rate-control algorithms to >> choose from, but that doesn't appear to be the case anymore. As a >> workaround, I wrote a little script that checks if that part of the >> driver is using more than 200 KiB of memory and run it every minute via >> cron. It seems to be doing its job so far: >> > > You can still select the ath rate control module. Static kernel config > is unchanged; for modules you must export ATH_RATE=onoe or similar > (check modules/ath/Makefile). Please file a PR if this does not work. > > Sam > (I had to go do some other stuff, but better late than never?) Thanks. That does indeed work, but the problem persists with other rate-control algorithms (I've upgraded most of the access points to 8.0-R, where the problem does not appear to exist, and upgraded one to 7.3-R for continued testing--this is where it still happens). I've instrumented the memory-allocation bits in the ath and net80211 code where MALLOC/malloc was called with a type of M_80211_NODE. I've tracked the leak down to one of two allocations never being freed: Line 595 of /usr/src/sys/net80211/ieee80211_node.c: MALLOC(ni, struct ieee80211_node *, sizeof(struct ieee80211_node), M_80211_NODE, M_NOWAIT | M_ZERO); Line 3164 of /usr/src/sys/dev/ath/if_ath.c: an = malloc(space, M_80211_NODE, M_NOWAIT|M_ZERO); It looks like both are supposed to be freed by node_free() in /usr/src/sys/net80211/ieee80211_node.c, but there is some code path where that doesn't happen, and should. Hopefully, this helps someone familiar with the code track it down. I may try it at some point, but it intimidates me somewhat. -Boris