0

I would like to reduce the wear of my SSD.

I'm trying to understand the mechanics of zswap:

Is zswap only used after the uncompresed swap is full?

If no, what is the allocation policy?

Tom Hale
  • 28,728
  • 32
  • 139
  • 229

1 Answers1

1

The documentation says:

Zswap evicts pages from compressed cache on an LRU basis to the backing swap device when the compressed pool reaches its size limit. This requirement had been identified in prior community discussions.

This means that zswap (which is held in RAM) is used before swap, and when full, the oldest pages will be moved to swap to make space for new pages waiting to be written to zswap.

Temporal locality says that more recently used pages are more likely to be used again.

Tom Hale
  • 28,728
  • 32
  • 139
  • 229