49b9e02ddfe0ea7590c677ae0574c880932a97dd
This "size"/factor/percentage represents the total amount of **uncompressed** data that is allowed to be written to the zram-backed swap device. It is **not** the amount of RAM to use for zram swap (as I had previously and erroneously thought.) What this means is that if we set the percent to 50% on a device with 3GB of RAM then up to 1.5GB of *uncompressed* data can be written to it, BUT since compression algos usually do better than a ratio of 1:1... less than 1.5GB of RAM will actually be occupied by this data when it is compressed. A 1.5:1 compression ratio seems relatively safe to assume, even if we use lz4 (which is less "good" at compressing than zstd), so I propose we set the size to 150%. Some distros (PureOS) set this higher (200%), but I think we should be somewhat conservative since we want to avoid any thrashing in case the compression ratio at runtime ends up being less than 2:1 for some reason. This does set a limit of 50% for devices with >32GB of RAM, to reduce overhead with using a larger amount of zram swap. The kernel documentation for zram suggests there's a 0.1% overhead, so if we let this amount get large then it could be tens or hundreds of MB of RAM "wasted." The amount I chose is kinda arbitrary, I think this can be improved later. At the very least, users can change this amount in the deviceinfo variable. Fixes #4250 Signed-off-by: Clayton Craft <craftyguy@postmarketos.org> Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7754>
postmarketOS aports repository
This repository contains the APKBUILD files for postmarketOS-specific packages, along with the required patches and scripts, if any.
There are many more packages defined in the Alpine Linux aports on which these packages depend.
Helpful resources:
- How to create a package
- APKBUILD reference
- pmaports commit style
- Review and merging guidelines
- Alpine Linux aports
- Alpine Linux package search
- postmarketOS package search
Git Hooks
You can find some useful git hooks in the .githooks directory.
To use them, run the following command after cloning this repository:
git config --local core.hooksPath .githooks
Languages
Shell
95.8%
Python
2.5%
C
1.2%
Batchfile
0.3%
Jinja
0.2%