possible memory leak or memory waste

Michal Kazior michal.kazior at tieto.com
Tue May 26 02:21:47 PDT 2015


On 26 May 2015 at 10:37, Sebastian Gottschall <s.gottschall at dd-wrt.com> wrote:
> 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:
[...]
>> 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.

How did it crash, i.e. did you manage to get a call trace? If not, can
you connect UART to the system and get one, please?


> 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

 1. Is the router acting as an endpoint in the traffic or a bridge?
 2. So does it crash or is free memory just low during traffic? It's
not clear to me.


>>> 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.

The amount of memory in a virtual machine doesn't matter. If anything
I should be seeing _more_ memory being consumed since kernel should be
more relaxed due to smaller memory pressure.

I have a very bare VM if you're implying I have a lot of background noise.

If you're still doubting here's a couple of printouts (I've run my VM
with 64MB of RAM; some of it is obviously reserved and unreachable):

user processes:
>     1 ?        S      0:01 /bin/sh /init
>  1189 ?        Ss     0:00 udevd --daemon
>  1471 ?        Ss     0:00 /usr/sbin/sshd
>  1530 ttyS0    Ss+    0:00 /bin/login -f
>  1533 ttyS0    S+     0:00  \_ -rc
>  1564 ttyS0    R+     0:00      \_ ps fax
(everything else is kernel threads)

after boot (ath10k module loaded and probed):
>              total       used       free     shared    buffers     cached
> Mem:         46928      33808      13120        152          0       5156
> -/+ buffers/cache:      28652      18276
> Swap:            0          0          0

hostad+iperf:
>              total       used       free     shared    buffers     cached
> Mem:         46928      44672       2256        440          0       2952
> -/+ buffers/cache:      41720       5208
> Swap:            0          0          0

hostapd (no iperf):
>              total       used       free     shared    buffers     cached
> Mem:         46928      42436       4492        500          0       2784
> -/+ buffers/cache:      39652       7276
> Swap:            0          0          0

hostapd stopped:
>              total       used       free     shared    buffers     cached
> Mem:         46928      32220      14708        388          0       2604
> -/+ buffers/cache:      29616      17312
> Swap:            0          0          0

ath10k_pci and ath10k_core unloaded:
>              total       used       free     shared    buffers     cached
> Mem:         46928      28552      18376        144          0       4712
> -/+ buffers/cache:      23840      23088
> Swap:            0          0          0

While running iperf I was able to get 400mbps+ of UDP traffic with
another 2x2 11ac device without much trouble.

Do note: The VM is running a glibc based system and has kernel and
modules with full debugging hence the high base memory usage. Yet it
still manages to work just fine.


> 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

You must be aware you can't compare ath10k to LSDK apples to apples.
Their QSDK includes kernel customizations which makes it nearly
impossible to compare. They may have some fixes for the platform
itself that haven't been upstreamed for what it's worth.


Michał



More information about the ath10k mailing list