From owner-freebsd-mips@FreeBSD.ORG Thu Sep 19 04:39:20 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76117E57; Thu, 19 Sep 2013 04:39:20 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-x22b.google.com (mail-ee0-x22b.google.com [IPv6:2a00:1450:4013:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 845232F5C; Thu, 19 Sep 2013 04:39:19 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id e52so3846750eek.2 for ; Wed, 18 Sep 2013 21:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xjVvIAgkKal+3SsODNmqHYINvLX0zAzUXOVlpKCVd2s=; b=TRFBAGcTXWfVEcBUPd6DWkajkJduXSHlYxNRH4O5ZFde+3VDpGocuXMDhhTP0zmdiT NcJsdB1sDVyMx44Uwa1vudY+EB+9I6UhToQgJu589qldZVH/Lp129lqOQAB2DsdJxQer PN+MPh7DYJq06gXaTST5LdAh9bly709J+Vfo75p0A/9oHggKGbbBVZbwYiidCkB3SIL0 fi1j1kVx0gDwrWy0sGHq/bHV8UNnAfUP0+SkMGcDRG1X9Y5Ks9ael66YsPgnRNYe3/hR LqoK4p/uTcGamHgu4btqXP0ZRTlocGjRyO3UVqhl9AjsqJ/0rL58NAOIgxEKumAwevs3 6WfQ== MIME-Version: 1.0 X-Received: by 10.14.103.69 with SMTP id e45mr8468169eeg.51.1379565556823; Wed, 18 Sep 2013 21:39:16 -0700 (PDT) Received: by 10.14.105.137 with HTTP; Wed, 18 Sep 2013 21:39:16 -0700 (PDT) In-Reply-To: References: <9CBFAD35-D651-4E28-BEBB-DC3717F38567@bsdimp.com> <1378583762.1111.512.camel@revolution.hippie.lan> Date: Wed, 18 Sep 2013 21:39:16 -0700 Message-ID: Subject: Re: mbuf autotuning effect From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-mips@freebsd.org" , Ian Lepore , freebsd-embedded X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2013 04:39:20 -0000 Removing -net@, Adding -embedded@ On Sat, Sep 7, 2013 at 10:57 PM, hiren panchasara < hiren.panchasara@gmail.com> wrote: > > > > On Sat, Sep 7, 2013 at 1:39 PM, Adrian Chadd wrote: > >> On 7 September 2013 12:56, Ian Lepore wrote: >> >> >>> I think the part of this that strikes me as strange is calling 20% of >>> physical memory used for network buffers a "very low value". It seems >>> outrageously high to me. I'd be pissed if that much memory got wasted >>> on network buffers on one of our $work platforms with so little memory. >>> >>> So the fact that you think it's crazy-low and I think it's crazy-high >>> may be a sign that it's auto-tuned to a reasonable compromise, and in >>> both our cases the right fix would be to use the available knobs to tune >>> things for our particular uses. >>> >> >> Well, which limit is actually being hit here? 20% of 32mb is still a lot >> of memory buffers.. >> >> Now, for sizing up the needed buffers for wifi: >> >> assuming 512 tx, 512 rx buffers for two ath NICs. >> >> another 512+512 buffers for each arge NICs. >> >> So, 4096 mbufs here, 2k each, so ~ 8mb of RAM. >> > > And we are only getting 6mb of maxmbufmem with current setup. > > Index: mips/include/vmparam.h > =================================================================== > --- mips/include/vmparam.h (revision 255320) > +++ mips/include/vmparam.h (working copy) > @@ -119,7 +119,7 @@ > * is the total KVA space allocated for kmem_map. > */ > #ifndef VM_KMEM_SIZE_SCALE > -#define VM_KMEM_SIZE_SCALE (3) > +#define VM_KMEM_SIZE_SCALE (1) > #endif > > /* > > As I mentioned on another reply in the same thread, VM_KMEM_SIZE_SCALE is > 1 for amd64. If I do the same for mips as above, we get > > # sysctl -a | grep maxmbuf > kern.ipc.maxmbufmem: 14407680 > > Now, do we want to have this much rams assigned to mbufs is another > question. > I am proposing following change for tplink TP-WN1043ND. This will get maxmbufmem *up* from 6mb to 14mb out of total 32mb. Index: sys/mips/conf/TP-WN1043ND =================================================================== --- sys/mips/conf/TP-WN1043ND (revision 255680) +++ sys/mips/conf/TP-WN1043ND (working copy) @@ -15,6 +15,8 @@ # Force the board memory - 32mb options AR71XX_REALMEM=32*1024*1024 +options VM_KMEM_SIZE_SCALE=1 + # i2c GPIO bus device gpioiic device iicbb I do not see any other side-effects of it. Please correct me if I am wrong. cheers, Hiren