lkml.org 
[lkml]   [2017]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/mprotect: Add a cond_resched() inside change_pte_range()
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

\
 
 \ /
  Last update: 2017-12-14 10:34    [W:0.257 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site