diff options
author | Rui Salvaterra <rsalvaterra@gmail.com> | 2020-06-23 12:29:54 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-07-11 13:33:28 +0200 |
commit | 0bd7dfa3ed60588ec83a8f60f48b6991ebb16940 (patch) | |
tree | 89a3ed8b98c85f7f60935528257cc48711f20e0a /package/system/zram-swap/files/zram.init | |
parent | c5c652e5ad97335eb3968dab6be0d7152e22893b (diff) | |
download | upstream-0bd7dfa3ed60588ec83a8f60f48b6991ebb16940.tar.gz upstream-0bd7dfa3ed60588ec83a8f60f48b6991ebb16940.tar.bz2 upstream-0bd7dfa3ed60588ec83a8f60f48b6991ebb16940.zip |
zram-swap: enable swap discard
Zram block devices have supported trim/discard for over six years, let's
enable it. This allows the zram device to actually free up allocated memory
when it's marked as unused in the filesystem metadata, as explained in more
detail in the original commit message [1].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/block/zram/zram_drv.c?h=linux-4.14.y&id=f4659d8e620d08bd1a84a8aec5d2f5294a242764
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Diffstat (limited to 'package/system/zram-swap/files/zram.init')
-rwxr-xr-x | package/system/zram-swap/files/zram.init | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index c855bbc087..a6126e578f 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -182,7 +182,7 @@ start() zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" - swapon $zram_priority "$zram_dev" + swapon -d $zram_priority "$zram_dev" } stop() |