From 233cece8a9c109a06f311329c054c49a742e9c60 Mon Sep 17 00:00:00 2001 From: PeronGH Date: Tue, 28 Jan 2025 20:31:49 +0000 Subject: [PATCH 1/3] fix: optimize kernel parameters for ZRAM-only setup --- .../desktop/shared/usr/lib/sysctl.d/65-virtual-memory.conf | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 system_files/desktop/shared/usr/lib/sysctl.d/65-virtual-memory.conf diff --git a/system_files/desktop/shared/usr/lib/sysctl.d/65-virtual-memory.conf b/system_files/desktop/shared/usr/lib/sysctl.d/65-virtual-memory.conf new file mode 100644 index 0000000000..9de1608fcb --- /dev/null +++ b/system_files/desktop/shared/usr/lib/sysctl.d/65-virtual-memory.conf @@ -0,0 +1,5 @@ +# The values come from https://wiki.archlinux.org/title/Zram#Optimizing_swap_on_zram +vm.swappiness = 180 +vm.watermark_boost_factor = 0 +vm.watermark_scale_factor = 125 +vm.page-cluster = 0 \ No newline at end of file From 2991bfcf4e5603ce91707f2a97c23dbd09be1ca3 Mon Sep 17 00:00:00 2001 From: PeronGH Date: Tue, 28 Jan 2025 20:36:29 +0000 Subject: [PATCH 2/3] fix: set the zram size to RAM on both deck and desktop --- system_files/deck/shared/etc/systemd/zram-generator.conf | 3 --- system_files/desktop/shared/etc/systemd/zram-generator.conf | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 system_files/deck/shared/etc/systemd/zram-generator.conf diff --git a/system_files/deck/shared/etc/systemd/zram-generator.conf b/system_files/deck/shared/etc/systemd/zram-generator.conf deleted file mode 100644 index 6dc8efafec..0000000000 --- a/system_files/deck/shared/etc/systemd/zram-generator.conf +++ /dev/null @@ -1,3 +0,0 @@ -[zram0] -zram-size=max(ram/4, 4096) -compression-algorithm=lz4 diff --git a/system_files/desktop/shared/etc/systemd/zram-generator.conf b/system_files/desktop/shared/etc/systemd/zram-generator.conf index 908e65be7c..739a3207ed 100644 --- a/system_files/desktop/shared/etc/systemd/zram-generator.conf +++ b/system_files/desktop/shared/etc/systemd/zram-generator.conf @@ -1,2 +1,3 @@ [zram0] +zram-size=ram compression-algorithm=lz4 From 296cfcf8851a064f10ea1047f5dc52734ea87d8d Mon Sep 17 00:00:00 2001 From: PeronGH Date: Tue, 28 Jan 2025 20:40:38 +0000 Subject: [PATCH 3/3] chore(readme): reflect changes on ZRAM --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d9fec214d..1345549ab0 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ Variant designed for usage as an alternative to SteamOS on the Steam Deck, and f - Update break something? Easily roll back to the previous version of Bazzite thanks to `rpm-ostree`'s rollback functionality. You can even select previous images at boot. - Steam and Lutris preinstalled on the image as layered packages. - [Discover Overlay](https://github.com/trigg/Discover) for Discord pre-installed and automatically launches in both Game mode and on the Desktop if Discord is installed. [View the official documentation here](https://trigg.github.io/Discover/bazzite). -- Uses ZRAM(4GB) with the ZSTD compression algorithm by default with the option to switch back to a 1GB swap file and set a custom size for it if desired. +- Uses ZRAM(same size as RAM) with the LZ4 compression algorithm by default with optimized kernel parameters. - [LAVD](https://crates.io/crates/scx_lavd) and [BORE](https://github.com/firelzrd/bore-scheduler) CPU Schedulers for smooth and responsive gameplay. - Kyber I/O scheduler to prevent I/O starvation when installing games or during background `duperemove` process. - Applies SteamOS's kernel parameters.