From 56526cf940766bda65e6c3505092e6ba2598ad44 Mon Sep 17 00:00:00 2001 From: Charan Teja Kalla Date: Mon, 1 Jul 2024 17:40:21 +0530 Subject: [PATCH] ANDROID: mm: swap: export and whitelist get_shadow_from_swap_cache The shadow entry in the swapcache contains information about a page that got swapped out during the reclaim which is then used at the time of refault to determine if a page is going to be a workingset or not. Once the page is swapped out, vendors can implement some algorithms on the swap area to determine if that page can be further pushed down to slower devices, Eg: say from costly and faster disk to slower disk. But if a page that is actively used is pushed to slower disk, the swapin is going to consume time which can show up in PSI events. The side effect of increased PSI events is, an example, increased kills by LMKD. Alternatively, vendors can rely on the information stored in the swapcache and determine if that particular page in the swap can be further pushed down to slower devices. Bug: 350429581 Change-Id: Ibeee10d40cc917229fe3b0fd9a6ef34ad27033e1 Signed-off-by: Charan Teja Kalla --- mm/swap_state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/swap_state.c b/mm/swap_state.c index 3e7db8ea40f3..df44400df83f 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -80,6 +80,7 @@ void *get_shadow_from_swap_cache(swp_entry_t entry) return page; return NULL; } +EXPORT_SYMBOL_GPL(get_shadow_from_swap_cache); /* * add_to_swap_cache resembles filemap_add_folio on swapper_space,