Skip to content
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

Merged
merged 3 commits into from
May 28, 2020
Merged

Fix increased RAM usage since OpenWrt 19.07 #2036

merged 3 commits into from
May 28, 2020

Conversation

neocturne
Copy link
Member

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 override CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256 from the generic config because the string 64 is sorted after 256. I have implemented a fix for this as well and will submit it as a separate PR when this is merged.

@neocturne neocturne added 0. type: regression 1. severity: blocker This issue/pr is required for the next release 2. status: waiting-on-review Awaiting review from the assignee but also interested parties. 0. type: bugfix This changeset fixes abug labels May 27, 2020
@neocturne neocturne added this to the 2020.2 milestone May 27, 2020
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.
@belzebub40k
Copy link
Contributor

belzebub40k commented May 28, 2020

I just upgraded a wr841v11 with this patch and the memory usage has gone down by ~10% compared to the previous reboot.

Copy link
Member

@blocktrron blocktrron left a 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 blocktrron merged commit fcc6877 into master May 28, 2020
@blocktrron blocktrron deleted the memusage branch May 28, 2020 17:40
@rotanid
Copy link
Member

rotanid commented May 28, 2020

@blocktrron it would have been nice to wait for feedback from the author of the issue before merging.
also, i don't see any reason why this could not have waited a while longer no matter my observation, why the rush?

@rotanid rotanid removed the 2. status: waiting-on-review Awaiting review from the assignee but also interested parties. label May 28, 2020
@blocktrron
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: bugfix This changeset fixes abug 0. type: regression 1. severity: blocker This issue/pr is required for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

significantly increased memory usage after upgrade to Gluon v2020.1.x
4 participants