ANDROID: mm: create vendor hooks for mm lru_lazyfree
Add vendor hook to add lazyfree to lru tail in lru_lazyfree Bug: 396330858 Change-Id: I3d421992811fa87cf1c5c45cfe2a08e06004da83 Signed-off-by: yipeng xiang <yipengxiang@honor.corp-partner.google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
81f28d1a9f
commit
99818c18b2
@@ -302,6 +302,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dpm_wait_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_uplink_send_msg);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inet_create);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sock_create);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_add_lazyfree_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_v4_connect);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_v6_connect);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_udp_v4_connect);
|
||||
|
||||
@@ -215,6 +215,9 @@ DECLARE_HOOK(android_vh_alloc_pages_slowpath_end,
|
||||
unsigned long pages_reclaimed, int retry_loop_count),
|
||||
TP_ARGS(gfp_mask, order, alloc_start, stime, did_some_progress,
|
||||
pages_reclaimed, retry_loop_count));
|
||||
DECLARE_HOOK(android_vh_add_lazyfree_bypass,
|
||||
TP_PROTO(struct lruvec *lruvec, struct folio *folio, bool *bypass),
|
||||
TP_ARGS(lruvec, folio, bypass));
|
||||
DECLARE_HOOK(android_vh_alloc_contig_range_not_isolated,
|
||||
TP_PROTO(unsigned long start, unsigned end),
|
||||
TP_ARGS(start, end));
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/pagemap.h>
|
||||
|
||||
#undef CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/mm.h>
|
||||
|
||||
/* How many pages do we try to swap or page in/out together? As a power of 2 */
|
||||
int page_cluster;
|
||||
const int page_cluster_max = 31;
|
||||
@@ -613,6 +616,7 @@ static void lru_deactivate(struct lruvec *lruvec, struct folio *folio)
|
||||
static void lru_lazyfree(struct lruvec *lruvec, struct folio *folio)
|
||||
{
|
||||
long nr_pages = folio_nr_pages(folio);
|
||||
bool folio_added = false;
|
||||
|
||||
if (!folio_test_anon(folio) || !folio_test_swapbacked(folio) ||
|
||||
folio_test_swapcache(folio) || folio_test_unevictable(folio))
|
||||
@@ -627,7 +631,9 @@ static void lru_lazyfree(struct lruvec *lruvec, struct folio *folio)
|
||||
* anonymous folios
|
||||
*/
|
||||
folio_clear_swapbacked(folio);
|
||||
lruvec_add_folio(lruvec, folio);
|
||||
trace_android_vh_add_lazyfree_bypass(lruvec, folio, &folio_added);
|
||||
if (!folio_added)
|
||||
lruvec_add_folio(lruvec, folio);
|
||||
|
||||
__count_vm_events(PGLAZYFREE, nr_pages);
|
||||
__count_memcg_events(lruvec_memcg(lruvec), PGLAZYFREE, nr_pages);
|
||||
|
||||
Reference in New Issue
Block a user