Skip to content

Commit e5a59d3

Browse files
dhowellstorvalds
authored andcommitted
mm/khugepaged.c: fix khugepaged's request size in collapse_file
collapse_file() in khugepaged passes PAGE_SIZE as the number of pages to be read to page_cache_sync_readahead(). The intent was probably to read a single page. Fix it to use the number of pages to the end of the window instead. Fixes: 99cb0db ("mm,thp: add read-only THP support for (non-shmem) FS") Signed-off-by: David Howells <[email protected]> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Song Liu <[email protected]> Acked-by: Yang Shi <[email protected]> Acked-by: Pankaj Gupta <[email protected]> Cc: Eric Biggers <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1774379 commit e5a59d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/khugepaged.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ static void collapse_file(struct mm_struct *mm,
17091709
xas_unlock_irq(&xas);
17101710
page_cache_sync_readahead(mapping, &file->f_ra,
17111711
file, index,
1712-
PAGE_SIZE);
1712+
end - index);
17131713
/* drain pagevecs to help isolate_lru_page() */
17141714
lru_add_drain();
17151715
page = find_lock_page(mapping, index);

0 commit comments

Comments
 (0)