ANDROID: vendor hooks: skip mem reclaim throttle to speed up mem alloc
Allowing certain important threads to skip waiting and direct mem reclaim, speeding up mem allocation for critical processes. Bug: 411514531 Change-Id: I56506249bb5eda705185476c71eb4b9c7e3a3a55 Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.corp-partner.google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
9b379efd25
commit
95e6a11201
@@ -478,6 +478,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_direct_reclaim_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_read_fault);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_pages_reclaim_start);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_pages_reclaim_cycle_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_throttle_direct_reclaim_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bd_link_disk_holder);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref);
|
||||
|
||||
@@ -98,6 +98,9 @@ DECLARE_HOOK(android_vh_direct_reclaim_begin,
|
||||
DECLARE_HOOK(android_vh_direct_reclaim_end,
|
||||
TP_PROTO(int prio),
|
||||
TP_ARGS(prio));
|
||||
DECLARE_HOOK(android_vh_throttle_direct_reclaim_bypass,
|
||||
TP_PROTO(bool *bypass),
|
||||
TP_ARGS(bypass));
|
||||
|
||||
#endif /* _TRACE_HOOK_VMSCAN_H */
|
||||
/* This part must be outside protection */
|
||||
|
||||
@@ -6574,6 +6574,7 @@ static bool throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
|
||||
struct zoneref *z;
|
||||
struct zone *zone;
|
||||
pg_data_t *pgdat = NULL;
|
||||
bool bypass = false;
|
||||
|
||||
/*
|
||||
* Kernel threads should not be throttled as they may be indirectly
|
||||
@@ -6622,6 +6623,10 @@ static bool throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
|
||||
if (!pgdat)
|
||||
goto out;
|
||||
|
||||
trace_android_vh_throttle_direct_reclaim_bypass(&bypass);
|
||||
if (bypass)
|
||||
goto out;
|
||||
|
||||
/* Account for the throttling */
|
||||
count_vm_event(PGSCAN_DIRECT_THROTTLE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user