The other pagetable walks in task_mmu.c have a cond_resched() after walking their ptes: add a cond_resched() in gather_pte_stats() too, for reading /proc/<id>/numa_maps. Only pagemap_pmd_range() has a cond_resched() in its (unusually expensive) pmd_trans_huge case: more should probably be added, but leave them unchanged for now. Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx> --- fs/proc/task_mmu.c | 1 + 1 file changed, 1 insertion(+) --- 4.9-rc8/fs/proc/task_mmu.c 2016-10-23 17:33:00.156860538 -0700 +++ linux/fs/proc/task_mmu.c 2016-12-05 20:27:04.084531599 -0800 @@ -1588,6 +1588,7 @@ static int gather_pte_stats(pmd_t *pmd, } while (pte++, addr += PAGE_SIZE, addr != end); pte_unmap_unlock(orig_pte, ptl); + cond_resched(); return 0; } #ifdef CONFIG_HUGETLB_PAGE -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>