summaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-08-07 20:37:32 +0100
committerAndrew Morton <akpm@linux-foundation.org>2024-09-01 20:26:05 -0700
commit94dc8bffd8b7fe83ba8382a3410a2f218dc20cb0 (patch)
treeefb2372e8f788ee781ef1770654ed0787ed007b5 /mm/swapfile.c
parent09022bc196d23484a7a5d48cf373f8583e3fcf23 (diff)
downloadlinux-stable-94dc8bffd8b7fe83ba8382a3410a2f218dc20cb0.tar.gz
linux-stable-94dc8bffd8b7fe83ba8382a3410a2f218dc20cb0.tar.bz2
linux-stable-94dc8bffd8b7fe83ba8382a3410a2f218dc20cb0.zip
mm: return the folio from swapin_readahead
The unuse_pte_range() caller only wants the folio while do_swap_page() wants both the page and the folio. Since do_swap_page() already has logic for handling both the folio and the page, move the folio-to-page logic there. This also lets us allocate larger folios in the SWP_SYNCHRONOUS_IO path in future. Link: https://lkml.kernel.org/r/20240807193734.1865400-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 0259f36de715..02bb4986a2c2 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1980,7 +1980,6 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
folio = swap_cache_get_folio(entry, vma, addr);
if (!folio) {
- struct page *page;
struct vm_fault vmf = {
.vma = vma,
.address = addr,
@@ -1988,10 +1987,8 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
.pmd = pmd,
};
- page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
+ folio = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
&vmf);
- if (page)
- folio = page_folio(page);
}
if (!folio) {
swp_count = READ_ONCE(si->swap_map[offset]);