summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
authorColin Cross <ccross@google.com>2020-07-21 21:55:56 +0530
committerSumit Semwal <sumit.semwal@linaro.org>2020-08-31 19:15:30 +0530
commitaa316726042bf5066d1a7649a57ae4c68a509ed0 (patch)
tree0e1163f17756e16ca5fa3c3ccd557f0eaf9fd627 /mm/memory.c
parentc80d26c88435ee1ab3475736ed3f39df80fd5694 (diff)
mm: rearrange madvise code to allow for reuse
Refactor the madvise syscall to allow for parts of it to be reused by a prctl syscall that affects vmas. Move the code that walks vmas in a virtual address range into a function that takes a function pointer as a parameter. The only caller for now is sys_madvise, which uses it to call madvise_vma_behavior on each vma, but the next patch will add an additional caller. Move handling all vma behaviors inside madvise_behavior, and rename it to madvise_vma_behavior. Move the code that updates the flags on a vma, including splitting or merging the vma as necessary, into a new function called madvise_update_vma. The next patch will add support for updating a new anon_name field as well. Signed-off-by: Colin Cross <ccross@google.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Jan Glauber <jan.glauber@gmail.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Rob Landley <rob@landley.net> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Kees Cook <keescook@chromium.org> Cc: "Serge E. Hallyn" <serge.hallyn@ubuntu.com> Cc: David Rientjes <rientjes@google.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Hugh Dickins <hughd@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Michel Lespinasse <walken@google.com> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Robin Holt <holt@sgi.com> Cc: Shaohua Li <shli@fusionio.com> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> [sumits: rebased over v5.9-rc3] Change-Id: I9c03595d8207ed1b556ad2ef31c7446053a24f6d
Diffstat (limited to 'mm/memory.c')
0 files changed, 0 insertions, 0 deletions