agama-project / agama

A service-based Linux installer
https://agama-project.github.io/
GNU General Public License v2.0
144 stars 43 forks source link

Enable zswap usage if swap exists #1490

Open ArmynC opened 3 months ago

ArmynC commented 3 months ago

A nice and quite unique addition would be the integration of a zswap toggleable option if Agama installer creates a swap partition/file or the user choose its manual swap.

In simpler terms, zswap could be a mix of a zram with swap, as it caches on ram (speedier temp memory) the page files, thus avoiding much i/o hard drive wear (SSD wary!). The difference resides in the fact that zswap can use the hard drive swap if necessary, by adding the uncompressable data or, in the case of a full ram.

On a key, "a basic 8 or 16 GB on disk without swap would be enough" isn't true all fhe time. As a scenario, a LLM system would consume that rather quickly. Secondly, by using an editing workspace alongside gaming and web, would touch the upper limit too.

By looking up the documentation (https://docs.kernel.org/admin-guide/mm/zswap.html), I can think that over time, the default parameters got to a desirable state, in which no custom config would be mandatory, beside the zswap.enabled=1 and perhaps if necessary, per case, a max_pool_percent.

Maybe due to the approaches on this matter, a disabled by default toggleable option would suffice. If the user should choose it, it is a click away.

Moreover, if the installation has no swap active, a zram option could be added too; a note on this one, some of opensuse community isn't that keen on it, because of its nature, though it is enabled by default on multiple distros.

ancorgs commented 3 months ago

Interesting suggestion. I may need to investigate a bit further.

Due to other tasks, this will likely not make it for Leap 16.0 (the first distribution expected to offer Agama as a supported installer). But adding it for Leap 16.1 sounds interesting.

jreidinger commented 3 months ago

Just note, Agama already by default uses zramswap to work on low memory machines: https://github.com/openSUSE/agama/blob/master/live/src/config.sh#L60

I expect in this issue you talk about enabling zswap on target system, right? As agama cannot access swap on disk until it creates one, which is quite late.