From owner-freebsd-embedded@FreeBSD.ORG Tue Jul 8 16:54:42 2014 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C7A931E; Tue, 8 Jul 2014 16:54:42 +0000 (UTC) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id C9CC128AA; Tue, 8 Jul 2014 16:54:41 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id B3790B84A; Tue, 8 Jul 2014 18:54:38 +0200 (SAST) Date: Tue, 8 Jul 2014 18:54:38 +0200 From: John Hay To: Adrian Chadd Subject: Re: CAMBRIA and more than one atheros card Message-ID: <20140708165438.GA83704@zibbi.meraka.csir.co.za> References: <20140707142538.GA43661@zibbi.meraka.csir.co.za> <1404753166.65432.10.camel@revolution.hippie.lan> <20140707182814.GA75629@zibbi.meraka.csir.co.za> <20140707193252.GA79553@zibbi.meraka.csir.co.za> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-wireless@freebsd.org" , Ian Lepore , "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 16:54:42 -0000 On Mon, Jul 07, 2014 at 12:43:17PM -0700, Adrian Chadd wrote: > Sweet! > > Can you run the same commands above on the Avila board? :~ # uname -a FreeBSD broken-2 11.0-CURRENT FreeBSD 11.0-CURRENT #74 r267954M: Fri Jun 27 14:40:34 SAST 2014 jhay@dolphin.meraka.csir.co.za:/usr/obj/arm.armeb/snaps/arm/11-tst/src/sys/SMALL-AVILA arm :~ # sysctl -a | grep hw | grep mem hw.physmem: 61087744 hw.usermem: 41558016 hw.realmem: 67104768 :~ # sysctl -a | grep maxmbuf kern.ipc.maxmbufmem: 9934848 I'm still confused that the Avila with half the RAM does not exhibit the same problem. > > Would you mind filing a PR to ensure we get that option into the > relevant kernel(s) ? Sure, give me a day or two. John > > (I'm kinda tempted to suggest we auto-select the scaling factor at > startup depending upon physical RAM .. ) > > > -a > > > On 7 July 2014 12:32, John Hay wrote: > > On Mon, Jul 07, 2014 at 11:59:03AM -0700, hiren panchasara wrote: > >> On Mon, Jul 7, 2014 at 11:31 AM, Adrian Chadd wrote: > >> > On 7 July 2014 11:28, John Hay wrote: > >> >> On Mon, Jul 07, 2014 at 11:22:46AM -0700, Adrian Chadd wrote: > >> >>> On 7 July 2014 10:12, Ian Lepore wrote: > >> >>> > On Mon, 2014-07-07 at 09:25 -0700, Adrian Chadd wrote: > >> >>> >> hi, > >> >>> >> > >> >>> >> That call is returning ENOMEM. I'm not sure why. It allocated an mbuf > >> >>> >> fine, but it couldn't allocate the DMA map. > >> >>> >> > >> >>> >> What's the output of "vmstat -z" ? I wonder if it's failing an allocation. > >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> -a > >> >>> > > >> >>> > Lack of bounce buffers is a posibility that won't show up in vmstat > >> >>> > output. > >> >>> > >> >>> right, but there's a bunch of already failing vmstat entries. > >> >>> > >> >>> > >> >>> John - there's a vmscale parameter somewhere. Hiren had to drop it > >> >>> down for his APs to work in 64MB of RAM. I think it's > >> >>> vm.kmem_size_scale . What's it say for you? > >> >>> > >> >> > >> >> :~ # sysctl vm.kmem_size_scale > >> >> vm.kmem_size_scale: 3 > >> > > >> > Ok. Search the archives for an email from Hiren titled "mbuf autotuning effect". > >> > > >> > TL;DR - set it to 1 and recompile. There's a kernel option somewhere > >> > to do exactly that. > >> > >> Yes. http://lists.freebsd.org/pipermail/freebsd-mips/2013-September/003081.html > >> > >> I went through this for my tplink. > >> > >> John, can you show o/p of: > >> > >> sysctl -a | grep hw | grep mem > >> and > >> sysctl -a | grep maxmbuf > > > > I already compiled a new kernel with "options VM_KMEM_SIZE_SCALE=1" and > > the problems went away. :-) On the new kernel the output is: > > > > ########################## > > :~ # sysctl -a | grep hw | grep mem > > hw.physmem: 128196608 > > hw.usermem: 103845888 > > hw.realmem: 134213632 > > :~ # sysctl -a | grep maxmbuf > > kern.ipc.maxmbufmem: 62705664 > > ########################## > > > > I rebooted with the old kernel and its output is: > > > > ########################## > > :~ # sysctl -a | grep hw | grep mem > > hw.physmem: 128196608 > > hw.usermem: 104124416 > > hw.realmem: 134213632 > > :~ # sysctl -a | grep maxmbuf > > kern.ipc.maxmbufmem: 20901888 > > ########################## > > > > So for the heck of it, I ran my script again and this time it successfully > > configured the 3 atheros interfaces. ? How can that be? One other thing I > > also do not understand. I have an Avila (with 64M RAM, half of the CAMBRIA), > > also with 3 atheros cards and there it always works. > > > > But if "options VM_KMEM_SIZE_SCALE=1" keeps the problem away, then I'll > > leave that in my kernel. :-) > > > > Thanks for everyone that helped. > > > > John > > -- > > John Hay -- jhay@meraka.csir.co.za / jhay@meraka.org.za