Skip to content
Snippets Groups Projects
Commit 3b2b74ff authored by Minchan Kim's avatar Minchan Kim Committed by Dmitry Skiba
Browse files

ANDROID: add vendor hook for mapping_shrinkable


To control inode memory reclaim, add restricted vendor hook.

Bug: 347958166
Change-Id: Iefb9ef66c9fd5abae99adb1200263e4642f991cc
Signed-off-by: default avatarMinchan Kim <minchan@google.com>
(cherry picked from commit c53c09b1)
Signed-off-by: default avatarDmitry Skiba <dskiba@google.com>
parent 8f50042a
No related branches found
No related tags found
No related merge requests found
......@@ -251,6 +251,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wait_for_work);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_madvise_pageout_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_madvise_pageout_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_reclaim_folio_list);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_mapping_shrinkable);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_oem_binder_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_received);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_oem_binder_struct);
......
......@@ -145,6 +145,8 @@ static inline bool mapping_empty(struct address_space *mapping)
return xa_empty(&mapping->i_pages);
}
extern void _trace_android_rvh_mapping_shrinkable(bool *shrinkable);
/*
* mapping_shrinkable - test if page cache state allows inode reclaim
* @mapping: the page cache mapping
......@@ -169,7 +171,11 @@ static inline bool mapping_empty(struct address_space *mapping)
static inline bool mapping_shrinkable(struct address_space *mapping)
{
void *head;
bool shrinkable = false;
_trace_android_rvh_mapping_shrinkable(&shrinkable);
if (shrinkable)
return true;
/*
* On highmem systems, there could be lowmem pressure from the
* inodes before there is highmem pressure from the page
......
......@@ -143,6 +143,9 @@ DECLARE_RESTRICTED_HOOK(android_rvh_madvise_pageout_end,
DECLARE_RESTRICTED_HOOK(android_rvh_reclaim_folio_list,
TP_PROTO(struct list_head *folio_list, void *private),
TP_ARGS(folio_list, private), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_mapping_shrinkable,
TP_PROTO(bool *shrinkable),
TP_ARGS(shrinkable), 1);
DECLARE_HOOK(android_vh_meminfo_cache_adjust,
TP_PROTO(unsigned long *cached),
TP_ARGS(cached));
......
......@@ -67,6 +67,12 @@
#include "swap.h"
void _trace_android_rvh_mapping_shrinkable(bool *shrinkable)
{
trace_android_rvh_mapping_shrinkable(shrinkable);
}
EXPORT_SYMBOL_GPL(_trace_android_rvh_mapping_shrinkable);
/*
* Shared mappings implemented 30.11.1994. It's not fully working yet,
* though.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment