mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm: vmscan: export func:shrink_slab
@ 2023-06-16  9:21 lipeifeng
  2023-06-16  9:42 ` David Hildenbrand
  0 siblings, 1 reply; 5+ messages in thread
From: lipeifeng @ 2023-06-16  9:21 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, surenb, gregkh, lipeifeng

From: lipeifeng <lipeifeng@oppo.com>

Some of shrinkers during shrink_slab would enter synchronous-wait
due to lock or other reasons, which would causes kswapd or
direct_reclaim to be blocked.

This patch export shrink_slab so that it can be called in drivers
which can shrink memory independently.

Signed-off-by: lipeifeng <lipeifeng@oppo.com>
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 6d0cd2840cf0..2e54fa52e7ec 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1043,7 +1043,7 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
  *
  * Returns the number of reclaimed slab objects.
  */
-static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
+unsigned long shrink_slab(gfp_t gfp_mask, int nid,
 				 struct mem_cgroup *memcg,
 				 int priority)
 {
@@ -1087,6 +1087,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
 	cond_resched();
 	return freed;
 }
+EXPORT_SYMBOL_GPL(shrink_slab);
 
 static unsigned long drop_slab_node(int nid)
 {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-25  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16  9:21 [PATCH] mm: vmscan: export func:shrink_slab lipeifeng
2023-06-16  9:42 ` David Hildenbrand
2023-06-20  3:05   ` 回复: " 李培锋(wink)
2023-06-25  9:23     ` 李培锋(wink)
2023-06-25  9:34     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®