Some devices, like the librem 5 (and I've heard the PBP too, and probably the pinephone, and others?) benefit by having zram swap, at least I see swap being used on my L5 when I enabled it with zram after ~1 day of use. I think this becomes even more useful in low-memory situations.
$ free -m total used free shared buff/cache availableMem: 2992 1273 710 178 1007 1478Swap: 747 182 565
I think it might be useful to have this enabled easily for other devices, possibly automatically with postmarketos-base-zram that can supply a good default /etc/conf.d/zram-init and depend on zram-init ?
Either it can be enabled automatically for all devices that have a UI installed (postmarketos-base-ui dependency), or it could be enabled only for specific devices by having the device package depend on it. Some kernel config is necessary (pmbootstrap!2075 (merged)), so maybe doing it per-device once the kernel has the required config is the way to go.
Or maybe enabling it by default is a terrible idea (if you think so, explain!)
Thoughts?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
zram is certainly useful on devices with less than 1 Gb RAM. I had troubles with RAM usage on my engineer-prototype 1 Gb PineTab. There it is almost vital. For other devices I'm not so sure if there is profit.
Enabling required kernel options is cetrainly useful.
Btw we already have "deviceinfo_swap_size_recommended" set for some devices and hadling of that in postmarketos-base
Btw we already have "deviceinfo_swap_size_recommended" set for some devices and hadling of that in postmarketos-base
Ya, I know, I wrote that :)
The problem is that only configures a file-based swap. That mechanism could be changed to just install zram-init and configure it using the swap_size_recommended specified in deviceinfo...
I think rising CPU usage on devices which are supposed to have crappy CPU isn't the best idea. I'd go with enabling kernel config options on all devices, adding some scripts or packages, but still go with opt-in. Maybe pmbootstrap should ask about it?
That's a good point. How about making it the default for devices that could really use it? Feedback in this thread suggests the PBP might be such a device, where paying the extra CPU overhead might be worth it: https://forum.pine64.org/showthread.php?tid=14190
Personally I would argue that swap-on-zram is worth it on any device with a sufficiently fast CPU. It effectively gives you some extra RAM for free, and even if the device has plenty of RAM, it gives you a bit more memory to work with before the out-of-memory killer has to kick in. If anything having plenty of memory is good since then you don't end up having to put things in swap very often, so there is very little extra CPU usage.
PBP has 4G RAM, I don't see it as device with constrained memory :/ I'm using PBP without any swap at all an rarely see it with more than 50% RAM usage. Maybe users workflows differ - then we can provide an option to enable zram easily, if user wants it (add that kernel option if it's missing). Maybe some short wiki page on how to do it on Alpine, whichwill look like
Personally I always had stability problems on devices using zram. Multiple OS' on both a RockPro64 4GB and a Raspberry Pi 3 started more or less randomly freezing and/or resetting when zram was in use.
I would make this opt-in, then we can enable it for devices where it's known to work well.
I think it might be useful to have this enabled easily for other devices, possibly automatically with postmarketos-base-zram that can supply a good default /etc/conf.d/zram-init and depend on zram-init ?
I'm thinking about a good prefix. it would be nice if we could imply in the prefix of the package that devices are supposed to depend on this (if they use it), because with postmarketos-base (+ postmarketos-base-ui) and postmarketos-config(-nftables) devices are never supposed to depend on them.
How about:
devicepkg-config-zram
devicepkg-dev could be refactored to provide devicepkg-dev and devicepkg-config-zram subpackages
devicepkg could also provide device quirks in the future: #1149 (closed)
@craftyguy: do you want to implement it? should be fairly easy, and it seems like a good improvement
I would make this opt-in, then we can enable it for devices where it's known to work well.
If we "enable it for devices where it's known to work well", then we're not making it opt-in anymore, and it sounds a lot like my original comment about enabling it by default on some devices.
Yes, I meant to say: not enable it on all devices (the title has "or all?"), but only on the ones where we know for sure that it gives a benefit, and it's worth the CPU overhead. So we probably mean the same thing :)
Maybe also another little note: On the original Android for my Xiaomi wt-88047 the init scripts actually have in if statement that enables zram if there is less than 1GB of ram. My guess is that that comes straight from Qualcomm. At the very least the engineers that set up this software didn't think it would be necessary on phones with 1GB or more ram.
quoting Rob Clark "how much RAM do you have on your phone? Enabling eviction (drm/msm modparam) plus zram swap can help. I'd use zram swap that as at least as large as RAM.. (I think we use 1.5x RAM size on chromebooks, and would like to move to 2x RAM size)"
so, please I have 8G and OOM killer said Hi to me
Before you ask: OOM got triggered not due to regular use, but running 10 concurrent replays of AAA games.