possible memory leak or memory waste

Sebastian Gottschall s.gottschall at dd-wrt.com
Tue May 26 01:37:51 PDT 2015


Am 26.05.2015 um 10:26 schrieb Michal Kazior:
> On 26 May 2015 at 09:23, Sebastian Gottschall <s.gottschall at dd-wrt.com> wrote:
>> Am 26.05.2015 um 07:42 schrieb Michal Kazior:
> [...]
>>> 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.
>> yes. but ath10k has its main usage on embedded devices. at least for AR9880
>> chipsets
> I'm aware of that.
>
>
>> since there is not even a windows driver available for AR9880.
>> so now consider that ath10k is not able to run on devices with good
>> stability, where the QCA LSDK Driver
>> does not seem to have that big resource problem.
> Did you measure LSDK the same way within same conditions? Same libc,
> same kernel, etc?
i measured userspace memory consumption. and all what cannot be seen can 
be counted as taken by the kernel.
>
> Do you see OOMs? What stability issues are we talking about?
>
> Did you try stressing the system by actually trying to consume memory
> until it's run out to see how much memory is _really_ left for the
> system to use?
no. the original dlink-dir859 firmware based on qca lsdk, does not 
provide oom's
but with ath10k i was able to crash my device, since it was running out 
of memory.
and i dont need to stress the system. running with one single client and 
8 mbit tx flow is enough to just have 2 mb ram free on a 64 mb system

>
>
>> so it doesnt make much sense to go on here in this way.
>> this resource problem must be solved. about 50 MB is really too much.
> I don't see this much memory being used with ath10k in my x86_64
> virtual machine even with `free`. I see ~10MB of less "free" memory
> after starting hostapd and running traffic for some time vs no hostapd
> and ath10k stopped.
you wont see the memory taken that easy and your x64 system has likelly 
alot of ram, so you dont notice that 50 mb are just taken by ath10k.
if you kill the hostapd process of ath10k, you will see the difference 
likelly.
one point here raised up, is that qca is aware of high memory 
consumption with vap's
my example has 2 vap's. i already provided a config file for hostapd on 
this mailing list
>
> I don't even see how ath10k could take 50MB directly. Perhaps there's
> some lazy memory recycling going on in the system? Maybe more memory
> is effectively consumed (compared to ath9k) due to alignment
> requirements or memory paging (which become more apparent with
> increased number of allocations)?
ath9k takes about 2 - 3 mb ram, if i compare the consumption before and 
after destroying a running ath9k hostapd instance.

>
>
> Michał
>
>>
>> Sebastian
>>
>>>
>>> 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