stuartiannaylor

Kernel config options

Fri Apr 19, 2019 4:52 am

[email protected]:/boot $ zcat /proc/config.gz | grep ZRAM
CONFIG_ZRAM=m
# CONFIG_ZRAM_WRITEBACK is not set

More of a noob question to advanced users but to set CONFIG_ZRAM_WRITEBACK=y is that a recompile or can you do it via cmdline.txt?

epoch1970
Posts: 2757
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Kernel config options

Fri Apr 19, 2019 7:09 am

If you look at https://www.kernel.org/doc/Documentatio ... v/zram.txt
You can see the option activates storing to media instead of working only off RAM. I haven’t gone through the makefile and header files but there is little doubt setting the option to Y inlines extra code in the module, making it bigger.
A recompilation will be needed and from there you can use the option as shown in the doc above.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

stuartiannaylor

Re: Kernel config options

Fri Apr 19, 2019 9:03 am

epoch1970 wrote:
Fri Apr 19, 2019 7:09 am
If you look at https://www.kernel.org/doc/Documentatio ... v/zram.txt
You can see the option activates storing to media instead of working only off RAM. I haven’t gone through the makefile and header files but there is little doubt setting the option to Y inlines extra code in the module, making it bigger.
A recompilation will be needed and from there you can use the option as shown in the doc above.
No I am struggling as rather than set up for recompiling just used a current Arch image I am using.
As for testing it will do

Code: Select all

[[email protected] ~]$ zcat /proc/config.gz | grep ZRAM
CONFIG_ZRAM=m
CONFIG_ZRAM_WRITEBACK=y
# CONFIG_ZRAM_MEMORY_TRACKING is not set

Code: Select all

[[email protected] ~]# cat /sys/block/zram1/backing_dev
/dev/mmcblk0p3
But setting any of the writeback functions just fails with permission errors

Code: Select all

[[email protected] ~]# ls /sys/block/zram1/
alignment_offset  compact         discard_alignment  holders    io_stat           mm_stat  removable  slaves
backing_dev       comp_algorithm  disksize           inflight   max_comp_streams  power    reset      stat
bdi               debug_stat      ext_range          initstate  mem_limit         queue    ro         subsystem
capability        dev             hidden             integrity  mem_used_max      range    size       uevent

Strange as would expect "echo idle > /sys/block/zramX/writeback" "echo all > /sys/block/zramX/idle" ... to be part of the virtual file system of the above

Return to “Advanced users”