diff --git a/mm/swap_state.c b/mm/swap_state.c index 260ac6a822b9..16709312e949 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -738,6 +738,12 @@ static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask, bool page_allocated; struct vma_swap_readahead ra_info = {0,}; + /* Moto huangzq2: don't readahead sync io pages */ + if (swap_slot_has_sync_io(fentry)) { + ra_info.win = 1; + goto skip; + } + swap_ra_info(vmf, &ra_info); if (ra_info.win == 1) goto skip; @@ -753,6 +759,9 @@ static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask, entry = pte_to_swp_entry(pentry); if (unlikely(non_swap_entry(entry))) continue; + /* Moto huangzq2: don't readahead sync io pages */ + if (swap_slot_has_sync_io(entry)) + continue; page = __read_swap_cache_async(entry, gfp_mask, vma, vmf->address, &page_allocated); if (!page)