Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 2013 21:39:16 -0700
From:      hiren panchasara <hiren.panchasara@gmail.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>, Ian Lepore <ian@freebsd.org>, freebsd-embedded <freebsd-embedded@freebsd.org>
Subject:   Re: mbuf autotuning effect
Message-ID:  <CALCpEUG%2Bn_5VxnZVGTexg-UYxy=HF4qr4a6P-eAip1Ws2wjo2g@mail.gmail.com>
In-Reply-To: <CALCpEUGMth00BdACdmAy%2BmhXcCVVTqpx23zwZrpZMeAb4fUxxg@mail.gmail.com>
References:  <CALCpEUHoAS2RRyO7JVOeSKWKiss9vZmN%2BxA1BDpwHDpkEYcjEA@mail.gmail.com> <CAJ-VmomAjsU%2Bnc=4AEdSn5gDhspc2YVrDtPophJvmee1kSTYog@mail.gmail.com> <9CBFAD35-D651-4E28-BEBB-DC3717F38567@bsdimp.com> <CALCpEUHh9o-scuoj_p-MGMZKn2d_Bbhtf8djV8MsLeOF8%2BKG9A@mail.gmail.com> <1378583762.1111.512.camel@revolution.hippie.lan> <CAJ-Vmon03Es2WJp%2B0p-_XuTdfqc8=daO8w1Kp4M=t0aNBoAruA@mail.gmail.com> <CALCpEUGMth00BdACdmAy%2BmhXcCVVTqpx23zwZrpZMeAb4fUxxg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <adrian@freebsd.org> wrote:
>
>> On 7 September 2013 12:56, Ian Lepore <ian@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALCpEUG%2Bn_5VxnZVGTexg-UYxy=HF4qr4a6P-eAip1Ws2wjo2g>