-
Notifications
You must be signed in to change notification settings - Fork 324
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
Fix increased RAM usage since OpenWrt 19.07 #2036
Conversation
This is unused by Gluon.
In OpenWrt 19.07, the block size was increased to 1024KiB for "tiny" devices by default to save flash. Unfortunately, this also significantly increases the cache memory required by squashfs. In my test, the increased block size reduced the image size by ~64KiB, but increased the RAM usage by ~2.6MiB. As most tiny devices have only 32MiB of RAM, this is not a reasonable tradeoff. The ar71xx-generic target already defines an even lower block size of 64KiB.
xt_CT was added to kmod-ipt-conntrack a while back. Update our GLUON_SPECIALIZE_KERNEL rules accordingly. When building xt_CT into the kernel, one of the symbols IP_NF_RAW and IP6_NF_RAW must be enabled as well, even though there is no runtime dependency when building as modules. The kernel grows by less than 1KB even when both IP_NF_RAW and NETFILTER_XT_TARGET_CT are enabled, making this change a (very slight) net win in both flash and RAM usage.
I just upgraded a wr841v11 with this patch and the memory usage has gone down by ~10% compared to the previous reboot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me on a OCEDO Koala as well as a TL-WR741ND v1
@blocktrron it would have been nice to wait for feedback from the author of the issue before merging. |
@rotanid As explained on IRC, the squashfs change is obvious when looking at the 18.06 <--> 19.07 diff. As multiple people (including myself) approved it reduces the memory load, we are good to got with that from my POV. |
The squashfs block size patch has the most significant effect (~2.6MB), the other two patches are only included for completeness - they presumably save around 10KB.
Fixes: #2032
While implementing this, I noticed an interesting effect in our config generation: the
CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=64
in ar71xx-generic is only able to overrideCONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256
from the generic config because the string64
is sorted after256
. I have implemented a fix for this as well and will submit it as a separate PR when this is merged.