mm: zram: skip readahead for sync io pages

Zram is a ram based swap, but Zram with writeback is ram + IO
based swap, so we still need readhead for the pages on backing
store, the page-cluster should be tuned on each chipset if we
enabled zram wb, beside this, we made this patch to skip readahead
on the page which has not been writebacked.

Change-Id: Ia219baf888cfc6ef4865f7c4d682ab4384de893c
Signed-off-by: huangzq2 <huangzq2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1900257
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1902452
Reviewed-by: Yonghui Jia <jiayh2@motorola.com>
Reviewed-by: Zhizhong Ge <gezz1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
This commit is contained in:
huangzq2 2021-03-13 19:28:24 +08:00 • committed by Xiaojun Ji
commit 1c3fe4abfa

View file

@ -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)