janithcooray / lin_os_swap_mod

increases the SWAP memory by an additional 4GB or 8GB for Android 7.0 or above
GNU General Public License v3.0
61 stars 6 forks source link

Swap priority #21

Open LostCat123 opened 4 months ago

LostCat123 commented 4 months ago

Is there a way to manually set the value of priority of the the swap, because whatever value I choose the swap always get more priority than the zram

"Set Swap Priority above Zram?" I chose "yes" and the priority of zram will be at -3 and swap at -2 Screenshot_20240418-131412

I chose "no" and it zram say -2 with swap on 0 Screenshot_20240418-192425

No matter what I choose, the swap is still prioritized over zram

devnoname120 commented 1 month ago

Same here, /dev/block/zram0 has a lower priority than /dev/swap/swapfile in /proc/swaps. I use the following module for zram so the problem may be that: https://github.com/reiryuki/ZRAM-Swap-Configurator-Magisk-Module

On a side note it would be great if this module could do both zram and swap so we don't need two modules which can potentially conflict with each other.

LostCat123 commented 1 month ago

Same here, /dev/block/zram0 has a lower priority than /dev/swap/swapfile in /proc/swaps. I use the following module for zram so the problem may be that: https://github.com/reiryuki/ZRAM-Swap-Configurator-Magisk-Module

On a side note it would be great if this module could do both zram and swap so we don't need two modules which can potentially conflict with each other.

The creator of that module added the ability to change zram priority now so I think it should be fine

devnoname120 commented 1 month ago

I confirm that this update fixed it:

% sudo cat /proc/swaps
Filename                                Type            Size       Used    Priority
/data/swap/swapfile                     file            8388604    179968  -2
/dev/block/zram0                        partition       2097148    2034584 0

For future travelers here is the relevant commit: https://github.com/reiryuki/ZRAM-Swap-Configurator-Magisk-Module/commit/33ae93c7491e5f597793190b05bc2b1945e7db9a