nefelim4ag / systemd-swap

Script for creating hybrid swap space from zram swaps, swap files and swap partitions.
GNU General Public License v3.0
546 stars 81 forks source link

On some multicore processors, Zram can cause slow start-up. #176

Closed daiaji closed 3 years ago

daiaji commented 4 years ago

I'm using 3900x (12c24t), and using the default configuration will result in too many zram devices to be created and mounted, and the boot speed will be very slow. If it makes sense to create multiple zram devices, you should consider multithreading to create and mount zram devices. I now use the parameterzram_count=1, the situation is relieved.

eMPee584 commented 4 years ago

I also noticed zram_count being set to number of CPU cores unconditionally, which was the only way to parallelize access before the introduction of "multi stream functionality" with kernel 3.15.

Since kernel 4.7

Regardless of the value passed to [max_comp_streams], ZRAM will always allocate multiple compression streams - one per online CPU - thus allowing several concurrent compression operations.