Skip to contentSkip to conversation

mm: add cond_resched() in gather_pte_stats()

PATCH New [email protected] 1 participant 1 message Dec 13, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 84/123 mm: add cond_resched() in gather_pte_stats()

From: Hugh Dickins <[email protected]>
Subject: mm: add cond_resched() in gather_pte_stats()

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.

---

 fs/proc/task_mmu.c |    1 +
 1 file changed, 1 insertion(+)
fs/proc/task_mmu.c renamed from fs/proc/task_mmu.c~mm-add-cond_resched-in-gather_pte_stats +1 -0
diff -puN fs/proc/task_mmu.c~mm-add-cond_resched-in-gather_pte_stats fs/proc/task_mmu.c
@@ -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

_