On Thu 14-12-17 10:40:21, Anshuman Khandual wrote: [...] > diff --git a/mm/mprotect.c b/mm/mprotect.c > index ec39f73..4fce0f5 100644 > --- a/mm/mprotect.c > +++ b/mm/mprotect.c > @@ -144,6 +144,7 @@ static unsigned long change_pte_range(struct > vm_area_struct *vma, pmd_t *pmd, > } while (pte++, addr += PAGE_SIZE, addr != end); > arch_leave_lazy_mmu_mode(); > pte_unmap_unlock(pte - 1, ptl); > + cond_resched(); > > return pages; > }
I would put this one level up to change_pmd_range to catch large THP backed regions. Something we do in zap_pmd_range. Other than that the patch makes sense to me. -- Michal Hocko SUSE Labs