Re: [PATCH v2 11/26] mm: merge parameters for change_protection()
From: Jerome Glisse
Date: Thu Feb 21 2019 - 12:32:48 EST
On Tue, Feb 12, 2019 at 10:56:17AM +0800, Peter Xu wrote:
> change_protection() was used by either the NUMA or mprotect() code,
> there's one parameter for each of the callers (dirty_accountable and
> prot_numa). Further, these parameters are passed along the calls:
>
> - change_protection_range()
> - change_p4d_range()
> - change_pud_range()
> - change_pmd_range()
> - ...
>
> Now we introduce a flag for change_protect() and all these helpers to
> replace these parameters. Then we can avoid passing multiple parameters
> multiple times along the way.
>
> More importantly, it'll greatly simplify the work if we want to
> introduce any new parameters to change_protection(). In the follow up
> patches, a new parameter for userfaultfd write protection will be
> introduced.
>
> No functional change at all.
>
> Signed-off-by: Peter Xu <peterx@xxxxxxxxxx>
It would have been nice if this was a coccinelle patch, easier to
review.
Reviewed-by: Jérôme Glisse <jglisse@xxxxxxxxxx>
> ---
> include/linux/huge_mm.h | 2 +-
> include/linux/mm.h | 14 +++++++++++++-
> mm/huge_memory.c | 3 ++-
> mm/mempolicy.c | 2 +-
> mm/mprotect.c | 29 ++++++++++++++++-------------
> 5 files changed, 33 insertions(+), 17 deletions(-)
[...]