
Create a vendor hook inside of gfp_zone() to modify which allocations get to enter ZONE_MOVABLE, by zeroing out __GFP_HIGHMEM inside of the trace hook based on certain conditions. Separately, create separate trace hooks in the swap-in and readahead paths to affect the behavior of the tracehook in gfp_zone(). Bug: 158645321 Change-Id: I4a4f0b724267ee120a1e5661f6da5d43d7ef6fc6 Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
39 lines
1014 B
C
39 lines
1014 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM mm
|
|
|
|
#define TRACE_INCLUDE_PATH trace/hooks
|
|
|
|
#if !defined(_TRACE_HOOK_MM_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_HOOK_MM_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/tracepoint.h>
|
|
#include <trace/hooks/vendor_hooks.h>
|
|
|
|
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
|
|
|
|
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
|
|
TP_PROTO(gfp_t *flags),
|
|
TP_ARGS(flags), 1);
|
|
DECLARE_RESTRICTED_HOOK(android_rvh_set_gfp_zone_flags,
|
|
TP_PROTO(gfp_t *flags),
|
|
TP_ARGS(flags), 1);
|
|
DECLARE_RESTRICTED_HOOK(android_rvh_set_readahead_gfp_mask,
|
|
TP_PROTO(gfp_t *flags),
|
|
TP_ARGS(flags), 1);
|
|
|
|
#else
|
|
|
|
#define trace_android_rvh_set_skip_swapcache_flags(gfp_flags)
|
|
#define trace_android_rvh_set_gfp_zone_flags(gfp_flags)
|
|
#define trace_android_rvh_set_readahead_gfp_mask(gfp_flags)
|
|
|
|
#endif
|
|
|
|
#endif /* _TRACE_HOOK_MM_H */
|
|
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|