mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
ANDROID: mm: gup: additional param in vendor hooks
It needs addtional struct page **pages params to judge whether it's possible to migrate pages out of CMA. Bug: 227475444 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I9a8aa57ff91228baf0fc970b8499464c07872c09
This commit is contained in:
@@ -15,20 +15,20 @@ DECLARE_HOOK(android_vh_try_grab_compound_head,
|
||||
TP_ARGS(page, refs, flags, ret));
|
||||
|
||||
DECLARE_HOOK(android_vh___get_user_pages_remote,
|
||||
TP_PROTO(int *locked, unsigned int *gup_flags),
|
||||
TP_ARGS(locked, gup_flags));
|
||||
TP_PROTO(int *locked, unsigned int *gup_flags, struct page **pages),
|
||||
TP_ARGS(locked, gup_flags, pages));
|
||||
|
||||
DECLARE_HOOK(android_vh_get_user_pages,
|
||||
TP_PROTO(unsigned int *gup_flags),
|
||||
TP_ARGS(gup_flags));
|
||||
TP_PROTO(unsigned int *gup_flags, struct page **pages),
|
||||
TP_ARGS(gup_flags, pages));
|
||||
|
||||
DECLARE_HOOK(android_vh_internal_get_user_pages_fast,
|
||||
TP_PROTO(unsigned int *gup_flags),
|
||||
TP_ARGS(gup_flags));
|
||||
TP_PROTO(unsigned int *gup_flags, struct page **pages),
|
||||
TP_ARGS(gup_flags, pages));
|
||||
|
||||
DECLARE_HOOK(android_vh_pin_user_pages,
|
||||
TP_PROTO(unsigned int *gup_flags),
|
||||
TP_ARGS(gup_flags));
|
||||
TP_PROTO(unsigned int *gup_flags, struct page **pages),
|
||||
TP_ARGS(gup_flags, pages));
|
||||
#endif /* _TRACE_HOOK_GUP_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
8
mm/gup.c
8
mm/gup.c
@@ -1740,7 +1740,7 @@ static long __get_user_pages_remote(struct mm_struct *mm,
|
||||
unsigned int gup_flags, struct page **pages,
|
||||
struct vm_area_struct **vmas, int *locked)
|
||||
{
|
||||
trace_android_vh___get_user_pages_remote(locked, &gup_flags);
|
||||
trace_android_vh___get_user_pages_remote(locked, &gup_flags, pages);
|
||||
|
||||
/*
|
||||
* Parts of FOLL_LONGTERM behavior are incompatible with
|
||||
@@ -1880,7 +1880,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages,
|
||||
if (!is_valid_gup_flags(gup_flags))
|
||||
return -EINVAL;
|
||||
|
||||
trace_android_vh_get_user_pages(&gup_flags);
|
||||
trace_android_vh_get_user_pages(&gup_flags, pages);
|
||||
|
||||
return __gup_longterm_locked(current->mm, start, nr_pages,
|
||||
pages, vmas, gup_flags | FOLL_TOUCH);
|
||||
@@ -2691,7 +2691,7 @@ static int internal_get_user_pages_fast(unsigned long start,
|
||||
/* Slow path: try to get the remaining pages with get_user_pages */
|
||||
start += nr_pinned << PAGE_SHIFT;
|
||||
pages += nr_pinned;
|
||||
trace_android_vh_internal_get_user_pages_fast(&gup_flags);
|
||||
trace_android_vh_internal_get_user_pages_fast(&gup_flags, pages);
|
||||
ret = __gup_longterm_unlocked(start, nr_pages - nr_pinned, gup_flags,
|
||||
pages);
|
||||
if (ret < 0) {
|
||||
@@ -2917,7 +2917,7 @@ long pin_user_pages(unsigned long start, unsigned long nr_pages,
|
||||
return -EINVAL;
|
||||
|
||||
gup_flags |= FOLL_PIN;
|
||||
trace_android_vh_pin_user_pages(&gup_flags);
|
||||
trace_android_vh_pin_user_pages(&gup_flags, pages);
|
||||
return __gup_longterm_locked(current->mm, start, nr_pages,
|
||||
pages, vmas, gup_flags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user