Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
zram
Commits
50013705
Commit
50013705
authored
Jul 31, 2020
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zram compression algorithm should be configurable
parent
06ae865a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
zram
zram
+3
-0
zramstart
zramstart
+3
-1
No files found.
zram
View file @
50013705
# The factor is swap/RAM ratio in percents
FACTOR=100
# The compressor is algorithm to use for compression
COMPRESSOR=lzo-rle
zramstart
View file @
50013705
#!/bin/sh
FACTOR
=
66
COMPRESSOR
=
lzo-rle
[
-f
/etc/zram
]
&&
source
/etc/zram
||
true
factor
=
$FACTOR
# percentage
compressor
=
$COMPRESSOR
# compressor
memtotal
=
$(
grep
MemTotal /proc/meminfo |
awk
' { print $2 } '
)
mem_used
=
$((
$memtotal
*
$factor
/
100
*
1024
))
modprobe
-q
zram
grep
-q
lzo-rle /sys/block/zram0/comp_algorithm
&&
echo
lzo-rle
>
/sys/block/zram0/comp_algorithm
grep
-q
$compressor
/sys/block/zram0/comp_algorithm
&&
echo
$compressor
>
/sys/block/zram0/comp_algorithm
echo
$mem_used
>
/sys/block/zram0/disksize
mkswap /dev/zram0
swapon
-p
100 /dev/zram0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment