Message ID | 20201122061722.Tef3ViFuW%akpm@linux-foundation.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/8] mm/madvise: fix memory leak from process_madvise | expand |
--- a/mm/madvise.c~mm-fix-madvise-willneed-performance-problem +++ a/mm/madvise.c @@ -226,7 +226,7 @@ static void force_shm_swapin_readahead(s struct address_space *mapping) { XA_STATE(xas, &mapping->i_pages, linear_page_index(vma, start)); - pgoff_t end_index = end / PAGE_SIZE; + pgoff_t end_index = linear_page_index(vma, end + PAGE_SIZE - 1); struct page *page; rcu_read_lock();