Skip to content
Commit 80a2c531 authored by Ryan Roberts's avatar Ryan Roberts
Browse files

mm: zswap: Store large folios without splitting



Previously zswap would refuse to store any folio bigger than order-0,
and therefore all of those folios would be sent directly to the swap
file. This is a minor inconvenience since swap can currently only
support order-0 and PMD-sized THP, but with the pending introduction of
"small-sized THP", and corresponding changes to swapfile to support any
order of folio, these large folios will become more prevalent and
without this zswap change, zswap will become unusable. Independently of
the "small-sized THP" feature, this change makes it possible to store
existing PMD-sized THPs in zswap.

Modify zswap_store() to allow storing large folios. The function is
split into 2 parts; zswap_store() does all the per-folio operations
(i.e. checking there is enough space, etc). Then it calls a new helper,
zswap_store_page(), for each page in the folio, which are stored as
their own entries in the zswap pool. (These entries continue to be
loaded back individually as single pages). If a store fails for any
single page, then all previously successfully stored folio pages are
invalidated.

Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
parent 15897894
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment