KTweak icon indicating copy to clipboard operation
KTweak copied to clipboard

[Question] about the fair swapiness

Open Mathias-Boulay opened this issue 3 years ago • 6 comments

Hello there, I've been looking into the nice script within this repo when something struck me as a bit weird.

The swapiness is set to 100 which as far as I know is the maximum value available. However, the comment state "swap at a fair rate" which seems weird.

I feel like I'm missing a piece of the puzzle here and would appreciate to be enlightened on how this value was chosen 😄

Mathias-Boulay avatar Mar 21 '22 06:03 Mathias-Boulay

As far as I understood it: Android doesn't (unless your OEM is dumb) use real swap, but ZRam only, which is swap-in-ram but compressed, and the compression is not expensive in sense of CPU time.

nift4 avatar Mar 29 '22 16:03 nift4

both can be used iirc, it is even called zswap

Mathias-Boulay avatar Mar 31 '22 08:03 Mathias-Boulay

Can be used yes, but in practice I only saw xiaomi doing it

nift4 avatar Mar 31 '22 18:03 nift4

Samsung started advertising swap as extended ram too

Mathias-Boulay avatar Apr 01 '22 05:04 Mathias-Boulay

On my laptop I use either Zram or Zswap (this currently), with a swappiness value of 200 (kernel 5.10+). It's better to swap early and little because that can be done fast, compared to swapping late and swapping a lot.

ghost avatar Apr 24 '22 01:04 ghost

Samsung started advertising swap as extended ram too

Samsung uses ZRAM writeback for their "RAM Plus" (RAM extension) feature.

TenSeventy7 avatar Jul 15 '22 03:07 TenSeventy7