Skip to content

Commit 55231e5

Browse files
hnaztorvalds
authored andcommitted
mm: madvise: fix MADV_WILLNEED on shmem swapouts
MADV_WILLNEED currently does not read swapped out shmem pages back in. Commit 0cd6144 ("mm + fs: prepare for non-page entries in page cache radix trees") made find_get_page() filter exceptional radix tree entries but failed to convert all find_get_page() callers that WANT exceptional entries over to find_get_entry(). One of them is shmem swap readahead in madvise, which now skips over any swap-out records. Convert it to find_get_entry(). Fixes: 0cd6144 ("mm + fs: prepare for non-page entries in page cache radix trees") Signed-off-by: Johannes Weiner <[email protected]> Reported-by: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7fcbbaf commit 55231e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/madvise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void force_shm_swapin_readahead(struct vm_area_struct *vma,
195195
for (; start < end; start += PAGE_SIZE) {
196196
index = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
197197

198-
page = find_get_page(mapping, index);
198+
page = find_get_entry(mapping, index);
199199
if (!radix_tree_exceptional_entry(page)) {
200200
if (page)
201201
page_cache_release(page);

0 commit comments

Comments
 (0)