ANDROID: vmscan: add vendor hook to tune scan control
Add vendor hook to tune scan control for direct reclaim. Bug: 351175506 Change-Id: Ice72a738f3b74949123be3b03d71f7ba638f161b Signed-off-by: Sooyong Suk <s.suk@samsung.corp-partner.google.com>
This commit is contained in:
committed by
Suren Baghdasaryan
parent
71984f5223
commit
852e218b49
@@ -311,3 +311,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_contig_range_not_isolated);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_warn_alloc_tune_ratelimit);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_warn_alloc_show_mem_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_use_vm_swappiness);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_scan_control);
|
||||
|
||||
@@ -46,6 +46,9 @@ DECLARE_HOOK(android_vh_rebalance_anon_lru_bypass,
|
||||
DECLARE_HOOK(android_vh_use_vm_swappiness,
|
||||
TP_PROTO(bool *use_vm_swappiness),
|
||||
TP_ARGS(use_vm_swappiness));
|
||||
DECLARE_HOOK(android_vh_tune_scan_control,
|
||||
TP_PROTO(bool *skip_swap),
|
||||
TP_ARGS(skip_swap));
|
||||
#endif /* _TRACE_HOOK_VMSCAN_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
@@ -6558,6 +6558,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
|
||||
.may_unmap = 1,
|
||||
.may_swap = 1,
|
||||
};
|
||||
bool skip_swap = false;
|
||||
|
||||
/*
|
||||
* scan_control uses s8 fields for order, priority, and reclaim_idx.
|
||||
@@ -6575,6 +6576,9 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
|
||||
if (throttle_direct_reclaim(sc.gfp_mask, zonelist, nodemask))
|
||||
return 1;
|
||||
|
||||
trace_android_vh_tune_scan_control(&skip_swap);
|
||||
if (skip_swap)
|
||||
sc.may_swap = 0;
|
||||
set_task_reclaim_state(current, &sc.reclaim_state);
|
||||
trace_mm_vmscan_direct_reclaim_begin(order, sc.gfp_mask);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user