Merge d5660df4a5
("Merge branch 'akpm' (patches from Andrew)") into android-mainline
steps on the way to 5.10-rc1 Change-Id: Iddc84c25b6a9d71fa8542b927d6f69c364131c3d Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
21
mm/madvise.c
21
mm/madvise.c
@@ -224,25 +224,28 @@ static void force_shm_swapin_readahead(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end,
|
||||
struct address_space *mapping)
|
||||
{
|
||||
pgoff_t index;
|
||||
XA_STATE(xas, &mapping->i_pages, linear_page_index(vma, start));
|
||||
pgoff_t end_index = end / PAGE_SIZE;
|
||||
struct page *page;
|
||||
swp_entry_t swap;
|
||||
|
||||
for (; start < end; start += PAGE_SIZE) {
|
||||
index = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
|
||||
rcu_read_lock();
|
||||
xas_for_each(&xas, page, end_index) {
|
||||
swp_entry_t swap;
|
||||
|
||||
page = find_get_entry(mapping, index);
|
||||
if (!xa_is_value(page)) {
|
||||
if (page)
|
||||
put_page(page);
|
||||
if (!xa_is_value(page))
|
||||
continue;
|
||||
}
|
||||
xas_pause(&xas);
|
||||
rcu_read_unlock();
|
||||
|
||||
swap = radix_to_swp_entry(page);
|
||||
page = read_swap_cache_async(swap, GFP_HIGHUSER_MOVABLE,
|
||||
NULL, 0, false);
|
||||
if (page)
|
||||
put_page(page);
|
||||
|
||||
rcu_read_lock();
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
lru_add_drain(); /* Push any new pages onto the LRU now */
|
||||
}
|
||||
|
Reference in New Issue
Block a user