possible memory leak or memory waste
Sebastian Gottschall
s.gottschall at dd-wrt.com
Tue May 26 04:19:17 PDT 2015
Am 26.05.2015 um 11:21 schrieb Michal Kazior:
> 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?
no real crash. its was a out of memory hang. so the userspace will not
work correct anymore
>
>
>> 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.
dlink asked me to port this device with dd-wrt so the router can be in
any situation.
right now its configured as standard accesspoint with 2 interfaces for
ath10k. (see my hostapd config i provided earlier today, it clearly
shows how its configured)
and the crash is pure out of memory. the traffic is constant about 8
mbit tx flow
>
>>>> 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.
if the userspace has no memory left, the kernel will raise oom handler
>
> 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
yes. i have alot of ram free. the system itself just takes 16 - 20 mb
ram out of 64 mb.
if i now start the ath10k interface, the whole system memory is almost
gone. (if traffic is flowing)
> (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
use the config i provided and generate some traffic. then you will see
that the left memory is running till zero
> hostad+iperf:
>> total used free shared buffers cached
>> Mem: 46928 44672 2256 440 0 2952
>> -/+ buffers/cache: 41720 5208
>> Swap: 0 0 0
you see it already here.
> 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.
mine is musl based. no debugging beside this
>
>
>> 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.
i know. but what we want to reach is that ath10k can be used in routers
with 64 mb ram. right now its not enough
and dd-wrt is highly optimized for small memory footprint. but it has
also features like nas storage or even freeradius which cannot be used
on such devices if all memory is already taken by a single driver
>
>
> Michał
>
More information about the ath10k
mailing list