mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
userfaultfd: non-cooperative: rename *EVENT_MADVDONTNEED to *EVENT_REMOVE
Patch series "userfaultfd: non-cooperative: add madvise() event for MADV_REMOVE request". These patches add notification of madvise(MADV_REMOVE) event to non-cooperative userfaultfd monitor. The first pacth renames EVENT_MADVDONTNEED to EVENT_REMOVE along with relevant functions and structures. Using _REMOVE instead of _MADVDONTNEED describes the event semantics more clearly and I hope it's not too late for such change in the ABI. This patch (of 3): The UFFD_EVENT_MADVDONTNEED purpose is to notify uffd monitor about removal of certain range from address space tracked by userfaultfd. Hence, UFFD_EVENT_REMOVE seems to better reflect the operation semantics. Respectively, 'madv_dn' field of uffd_msg is renamed to 'remove' and the madvise_userfault_dontneed callback is renamed to userfaultfd_remove. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport <[email protected]> Reviewed-by: Andrea Arcangeli <[email protected]> Acked-by: Hillf Danton <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
0262d9c845
commit
d811914d87
5 changed files with 28 additions and 28 deletions
|
|
@ -681,16 +681,16 @@ void mremap_userfaultfd_complete(struct vm_userfaultfd_ctx *vm_ctx,
|
|||
userfaultfd_event_wait_completion(ctx, &ewq);
|
||||
}
|
||||
|
||||
void madvise_userfault_dontneed(struct vm_area_struct *vma,
|
||||
struct vm_area_struct **prev,
|
||||
unsigned long start, unsigned long end)
|
||||
void userfaultfd_remove(struct vm_area_struct *vma,
|
||||
struct vm_area_struct **prev,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
struct mm_struct *mm = vma->vm_mm;
|
||||
struct userfaultfd_ctx *ctx;
|
||||
struct userfaultfd_wait_queue ewq;
|
||||
|
||||
ctx = vma->vm_userfaultfd_ctx.ctx;
|
||||
if (!ctx || !(ctx->features & UFFD_FEATURE_EVENT_MADVDONTNEED))
|
||||
if (!ctx || !(ctx->features & UFFD_FEATURE_EVENT_REMOVE))
|
||||
return;
|
||||
|
||||
userfaultfd_ctx_get(ctx);
|
||||
|
|
@ -700,9 +700,9 @@ void madvise_userfault_dontneed(struct vm_area_struct *vma,
|
|||
|
||||
msg_init(&ewq.msg);
|
||||
|
||||
ewq.msg.event = UFFD_EVENT_MADVDONTNEED;
|
||||
ewq.msg.arg.madv_dn.start = start;
|
||||
ewq.msg.arg.madv_dn.end = end;
|
||||
ewq.msg.event = UFFD_EVENT_REMOVE;
|
||||
ewq.msg.arg.remove.start = start;
|
||||
ewq.msg.arg.remove.end = end;
|
||||
|
||||
userfaultfd_event_wait_completion(ctx, &ewq);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue