Skip to content

Commit 42c06a0

Browse files
hnazakpm00
authored andcommitted
mm: kill frontswap
The only user of frontswap is zswap, and has been for a long time. Have swap call into zswap directly and remove the indirection. [[email protected]: remove obsolete comment, per Yosry] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: don't warn if none swapcache folio is passed to zswap_load] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Johannes Weiner <[email protected]> Signed-off-by: Yin Fengwei <[email protected]> Acked-by: Konrad Rzeszutek Wilk <[email protected]> Acked-by: Nhat Pham <[email protected]> Acked-by: Yosry Ahmed <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Cc: Domenico Cerasuolo <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Vitaly Wool <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent b8cf32d commit 42c06a0

File tree

17 files changed

+121
-991
lines changed

17 files changed

+121
-991
lines changed

Documentation/admin-guide/mm/zswap.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ compressed pool.
4949
Design
5050
======
5151

52-
Zswap receives pages for compression through the Frontswap API and is able to
52+
Zswap receives pages for compression from the swap subsystem and is able to
5353
evict pages from its own compressed pool on an LRU basis and write them back to
5454
the backing swap device in the case that the compressed pool is full.
5555

@@ -70,19 +70,19 @@ means the compression ratio will always be 2:1 or worse (because of half-full
7070
zbud pages). The zsmalloc type zpool has a more complex compressed page
7171
storage method, and it can achieve greater storage densities.
7272

73-
When a swap page is passed from frontswap to zswap, zswap maintains a mapping
73+
When a swap page is passed from swapout to zswap, zswap maintains a mapping
7474
of the swap entry, a combination of the swap type and swap offset, to the zpool
7575
handle that references that compressed swap page. This mapping is achieved
7676
with a red-black tree per swap type. The swap offset is the search key for the
7777
tree nodes.
7878

79-
During a page fault on a PTE that is a swap entry, frontswap calls the zswap
80-
load function to decompress the page into the page allocated by the page fault
81-
handler.
79+
During a page fault on a PTE that is a swap entry, the swapin code calls the
80+
zswap load function to decompress the page into the page allocated by the page
81+
fault handler.
8282

8383
Once there are no PTEs referencing a swap page stored in zswap (i.e. the count
84-
in the swap_map goes to 0) the swap code calls the zswap invalidate function,
85-
via frontswap, to free the compressed entry.
84+
in the swap_map goes to 0) the swap code calls the zswap invalidate function
85+
to free the compressed entry.
8686

8787
Zswap seeks to be simple in its policies. Sysfs attributes allow for one user
8888
controlled policy:

Documentation/mm/frontswap.rst

Lines changed: 0 additions & 264 deletions
This file was deleted.

Documentation/mm/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ above structured documentation, or deleted if it has served its purpose.
4444
balance
4545
damon/index
4646
free_page_reporting
47-
frontswap
4847
hmm
4948
hwpoison
5049
hugetlbfs_reserv

0 commit comments

Comments
 (0)