Skip to content

Commit 5d856fd

Browse files
committed
Merge remote-tracking branch 'origin/master' into dev-talesam
2 parents 8b03973 + 66c73b2 commit 5d856fd

2 files changed

Lines changed: 26 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Smart dynamic swap management for Linux, written in Rust.
1313

1414
## Installation
1515

16-
### Arch Linux / BigLinux
16+
### Arch Linux / BigLinux / Manjaro...
1717
```bash
1818
cd pkgbuild
1919
makepkg -si

include/swap-default.conf

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,35 @@ swap_mode=auto
1818

1919
################################################################################
2020
# Zswap Settings (used in zswap+swapfc mode)
21+
# This space is used for uncompressed memory. Since we have around a 3x compression ratio,
22+
# a system with 8 GB of RAM and 45% compressed memory usage can reach roughly 10.8 GB of
23+
# swap in RAM.
24+
#
25+
# However, keep in mind that 3.6 GB of RAM is no longer actually being used as regular RAM,
26+
# but rather as compressed cache. In practice, this is equivalent to around 15.2 GB total
27+
# (4.4 GB of RAM + 10.8 GB of swap compressed in RAM).
28+
#
29+
# 45% is a high value, but the kernel automatically manages when it is better to move swap
30+
# to storage, freeing up RAM, or when it is better to simply deallocate this memory.
31+
#
32+
# In addition, the system can automatically create swap files, allowing it to manage when
33+
# to move swap to storage. This makes it possible to use a few more gigabytes of swap when needed.
2134
################################################################################
2235

2336
zswap_compressor=zstd # Compression algo: zstd, lz4, lzo
24-
zswap_max_pool_percent=60 # Max RAM for compressed pool
37+
zswap_max_pool_percent=45 # Max RAM for compressed pool
2538
zswap_zpool=zsmalloc # Allocator
2639
zswap_shrinker_enabled=1 # Proactively move cold pages to disk
2740
zswap_accept_threshold=90 # Restart accepting pages when pool drops to X%
2841

2942
################################################################################
3043
# Zram Settings (used in zram modes)
44+
# Unlike zswap, with zram the reserved space corresponds to the virtual size of the
45+
# swap being created, not to a usage limit based on a percentage of physical memory.
46+
# Therefore, 90% in zram does not represent a higher virtual swap value than 45% in zswap.
3147
################################################################################
3248

33-
zram_size=80% # Size of zram device (e.g., 50%, 1G)
49+
zram_size=90% # Size of zram device (e.g., 50%, 1G)
3450
zram_alg=zstd # Compression algo
3551
zram_prio=32767 # Priority (highest)
3652

@@ -46,28 +62,25 @@ zram_writeback_threshold=50 # Trigger when zram is X% full
4662
################################################################################
4763

4864
# Progressive Scaling: Start small, grow as needed
49-
# e.g. 256M -> 256M -> 512M -> 512M... doubles every 4 files
5065
swapfc_enabled=1 # Enable swap files
5166
swapfc_path=/swapfc/swapfile # Directory and filename prefix
52-
swapfc_chunk_size=256M # Base size
53-
swapfc_max_chunk_size=32G # Max single file size
54-
swapfc_max_count=28 # Max number of files
67+
swapfc_chunk_size=512M # Base size
68+
swapfc_max_chunk_size=64G # Max single file size ( Theoretically be up to 16 TB or more )
69+
swapfc_max_count=32 # Max number of files ( Kernel limit is 32 )
5570
swapfc_scaling_step=4 # Double size every X files
71+
# Doubles every 4 files e.g. 512M -> 512M -> 512M -> 512M -> 1024M -> 1024M...
5672

5773
# Triggers
5874
swapfc_free_ram_perc=35 # Create swap when free RAM < X%
5975
swapfc_free_swap_perc=25 # Create more when free swap < X%
6076
swapfc_remove_free_swap_perc=55 # Remove files when free swap > X%
6177

62-
################################################################################
63-
# Advanced / Experimental
64-
################################################################################
65-
6678
# MGLRU Anti-Thrashing (Kernel 6.1+)
6779
# Protect working set for X ms. 0 to disable.
6880
mglru_min_ttl_ms=1000
6981

7082
# Sparse Files
7183
# Create files that only use disk space when actually written to.
72-
# Highly recommended for Zswap mode.
73-
# swapfc_use_sparse_disable=1 # Uncomment to disable (pre-allocate all space)
84+
# With pre-allocated space there should be a performance gain, however
85+
# more storage space will be reserved for swap, so the performance gain may not be noticeable.
86+
# swapfc_use_sparse_disable=1 # Uncomment to pre-allocate all space

0 commit comments

Comments
 (0)