lkml.org 
[lkml]   [2019]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 11/26] mm: merge parameters for change_protection()
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@redhat.com>

It would have been nice if this was a coccinelle patch, easier to
review.

Reviewed-by: Jérôme Glisse <jglisse@redhat.com>

> ---
> 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(-)

[...]

\
 
 \ /
  Last update: 2019-02-21 18:32    [W:0.513 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site