possible memory leak or memory waste

Michal Kazior michal.kazior at tieto.com
Mon May 25 22:42:35 PDT 2015


On 26 May 2015 at 02:07, Sebastian Gottschall <s.gottschall at dd-wrt.com> wrote:
> Am 26.05.2015 um 01:42 schrieb Ben Greear:
>>
>> Can you test with ath9k to make sure it is actually ath10k related?
>
> already tested. this device has 2 chipsets. one is ath9k based and the
> second is ath10k based. :-)
> only if i kill the hostapd process which controls ath10k. the memory waste
> is gone

Keep in mind that hostapd itself requires memory to function as well.
Each process (and thread) need some internal kernel memory (stack, et
al).


>> And/or try traffic in RX direction only to see if that still uses
>> lots of memory?
>
>
>>
>> Does memory come back after you just stop traffic (w/out stopping
>> hostapd)?
>
> yes. slowly. its fluctuating. so sometimes there is 30 mb free again and
> seconds later just 2 mb. so very heavy changes. on bigger routers with more
> than 64 mb (i have a second here with 128 mb)
> the total consumption stabilizes at 45 - 50 mb for the driver only which is
> still too much for sure.  so it may not a leak. but ath10k or the firmware
> is wasting too much memory for embedded devices
> and ar9880 is just used on embedded devices almost

Using `free` is a pretty poor way of assessing memory usage of a
kernel driver. It reports how much the OS has memory available to
userspace immediately (kernel recycles some memory for performance
reasons, e.g. SLAB does it). There's a lot of metadata too so what you
actually see is many other things that involve ath10k being used.

The driver itself should be consuming around 5MB of memory at idle
(interface up, no significant traffic). Most of this goes for the Rx
ring which has 1023*1920 bytes (+/- allocation and metadata waste).
Then there's a bunch of CE buffers as well which take up some memory
(used for driver-firmware communication), e.g. 2048*512 + 2048*128
(HTT and WMI, both target->host).

When Txing it may eat up additional 1424 * (MSDU size +
sizeof(skbuff)). Note that Tx queues can be longer - driver isn't
aware of qdiscs and those can store frames as well.

11ac supports frame aggregates going up to 1MB so these queues pretty
much need to be this long if you want to be able to get highest
possible throughput.


Michał

>
>>
>> Thanks,
>> Ben
>>
>>
>> On 05/25/2015 04:00 PM, Sebastian Gottschall wrote:
>>>
>>> Am 26.05.2015 um 00:39 schrieb Ben Greear:
>>>>
>>>> Default firmware has a hard-coded minimum number of tx buffers
>>>> (somewhere
>>>> more than 1k buffers I think).  Maybe driver is allocating all this
>>>> memory somehow?
>>>>
>>>> If you do one-way traffic tests (udp), I wonder if you can tell if it is
>>>> tx
>>>> or rx that consumes the memory?
>>>
>>> its tx. i have a ethernet over ip tunnel running on that link and i
>>> broadcast iptv in that way. (its my way to convert multicast to unicast)
>>> the  tunnel itself is rfc ethernet over ip, which is somewhat like udp.
>>> so connectionless protocol
>>>
>>> Sebastian
>>>>
>>>>
>>>> CT firmware can be configured to use any multiple-of-8 amount of tx
>>>> buffers, though I have not tested below around 600.
>>>>
>>>> Thanks,
>>>> Ben
>>>>
>>>> On 05/25/2015 02:26 PM, Sebastian Gottschall wrote:
>>>>>
>>>>> today using the latest testing driver, i found out the memory
>>>>> consumption is unbelievable high.
>>>>> my router here has 64 mb ram. this ram is fully taken after some
>>>>> minutes by ath10k. but only if data flow present.
>>>>>
>>>>> here the results of "free" after some minutes
>>>>> root at DD-WRT:~# free
>>>>> total         used         free       shared      buffers
>>>>> Mem:         61636        58752         2884            0 2600
>>>>> -/+ buffers:              56152         5484
>>>>> Swap:            0            0            0
>>>>>
>>>>>
>>>>> now i terminate hostapd which controls the ath10k chipset
>>>>>
>>>>>
>>>>> root at DD-WRT:~# kill 902
>>>>> root at DD-WRT:~# free
>>>>> total         used         free       shared      buffers
>>>>> Mem:         61636        23212        38424            0 2416
>>>>> -/+ buffers:              20796        40840
>>>>> Swap:            0            0            0
>>>>>
>>>>>
>>>>> you see the difference?
>>>>>
>>>>>
>>>>> regards,
>>>>> Sebastian Gottschall
>>>>>
>>>>> _______________________________________________
>>>>> ath10k mailing list
>>>>> ath10k at lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/ath10k
>>>>>
>>>>
>>>
>>
>
>
> _______________________________________________
> ath10k mailing list
> ath10k at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k



More information about the ath10k mailing list