From 3ca7a9ba58541d8692d3f83cbded2ad17be23359 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Mon, 20 Jul 2020 11:29:38 +0800 Subject: [PATCH] dbg: dump upon abnormal pte values --- mm/swap_state.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mm/swap_state.c b/mm/swap_state.c index 05889e8e3c97..c1973136d035 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -756,6 +756,17 @@ static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask, blk_start_plug(&plug); for (i = 0, pte = ra_info.ptes; i < ra_info.nr_pte; i++, pte++) { + pte_t *tpte = pte_offset_map(vmf->pmd, vmf->address); + + if (((unsigned long)pte >> PAGE_SHIFT) != + ((unsigned long)tpte >> PAGE_SHIFT)) { + pr_info("ra_info: %d, %d, %d, %p\n", + ra_info.win, ra_info.offset, ra_info.nr_pte, + ra_info.ptes); + pr_info("i: %d, pte: %p, faddr: %lx\n", i, pte, + vmf->address); + } + pte_unmap(tpte); pentry = *pte; if (pte_none(pentry)) continue; -- 2.27.0