-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wilc1000 driver memory leak after connected to AP and disconnected #93
Comments
Hi @xiebluelike, The memory usage can increase/decrease based on the usage and caching scheme. Now the driver doesn't maintain any scan results or connect information. All that information is maintained by the cfg80211 subsystem. To isolate if this issue observed because of continuous connection and disconnection with AP, it is better to check memory usage with the individual operation. |
Hi @ajaykathat, Thank you for your reply.
Looking forward to your reply. |
Hi @xiebluelike, Do you observe any difference in the rate at which memory is getting consumed between the modified and previous script for the same test time. From the script, it looks like it's just performing the scan without any connect operation. The same can be simulated without wpa_supplicant with changes like below and it will also help to rule out its involvement.
Actually, during scan operation, the driver doesn't keep any copy of the scan result. It may be worth validating the system memory usage without the scan operation too. |
Dear @ajaykathat I am xiebluelike's teammate. Recently with slabtop i find that the main memory leak is from kmalloc-512 . so i run a test.sh and then turn on /sys/kernel/slab/kmalloc-512/trace and save the trace log. 15 mintes later i analyze the log and find there is a very high probability(142-not-free / 263--total-malloc) of memory leak in cfg_scan_result()->cfg80211_inform_bss_frame()->__kmalloc(), because i can't find its free operate, see below: (memory leak in 15 mintes is 142x512=71KB, almost match the leak 4M per 13 hours in the test early ) Also kmalloc-256 leak memory too, which also mainly from cfg80211_inform_bss_frame, which leak 415-not-free / 2175--total-malloc in 50 mintes, see below: [28697.450000] TRACE kmalloc-256 alloc 0xc1ef3100 inuse=16 fp=0x (null)^M so i think this found may help for you to deal with wilc driver memory leak issue. Best Regard, |
Actually the memory allocated by cfg80211_inform_bss_frame() is maintained by cfg80211 subsystem. cfg8011 uses a reference count mechanism to keep track of allocated memory. There is no direct free for that allocated memory. cfg80211_put_bss() call is used to decrement the reference count which is already existed in the driver. |
Thank you for reply @ajaykathat |
I don't think cfg80211_inform_bss_frame() will take more then 50mins to free a single BSS entry if that network is not found in a continuous scan. after loading the module try these commands Giving "iw wlan0 scan dump -u" command again after some time will not give the results when the entries are expired. |
I used the development board sama5d27-som1-ek1 of microchip to test the Wilc1000-SD module;
I compiled wilc's driver as a ko file, loaded and ran it with a shell script like below:
After running for 12 hours and found that every time the connection to the AP was initiated and then disconnected, there would be a memory leak;
Some record from /wilc_test/test_info.txt like below:
Please let me know if there have any solution for this problem.
Thanks!
The text was updated successfully, but these errors were encountered: