From 12972dd7bfa306aa07c92966c4efe7b1c0c5e043 Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Wed, 23 Mar 2022 12:37:28 +0530 Subject: [PATCH] ANDROID: mm: Export kswapd function To support multiple kswap threads vendor modules need access to kswapd function. So, export it. Bug: 201263306 Change-Id: I442612710835f39836a295e9d1936f86826ab960 Signed-off-by: Vijayanand Jitta --- include/linux/swap.h | 2 ++ mm/vmscan.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index ba52f3a3478e..fce3a966718d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -34,6 +34,8 @@ struct pagevec; SWAP_FLAG_DISCARD_PAGES) #define SWAP_BATCH 64 +int kswapd (void *p); + static inline int current_is_kswapd(void) { return current->flags & PF_KSWAPD; diff --git a/mm/vmscan.c b/mm/vmscan.c index 52b622f82d30..0bf4b853757d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4296,7 +4296,7 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o * If there are applications that are active memory-allocators * (most normal use), this basically shouldn't matter. */ -static int kswapd(void *p) +int kswapd(void *p) { unsigned int alloc_order, reclaim_order; unsigned int highest_zoneidx = MAX_NR_ZONES - 1; @@ -4373,6 +4373,7 @@ kswapd_try_sleep: return 0; } +EXPORT_SYMBOL_GPL(kswapd); /* * A zone is low on free memory or too fragmented for high-order memory. If