Skip to contentSkip to conversation

mm: add kernel_misc_reclaimable in show_free_areas

PATCH Applied liuhailong 2 participants 4 messages Aug 13, 2021 – Aug 15, 2021

Subsystems (2)
lore
Share & tools
lore

liuhailong

author
#0 lore raw

PATCH 1/1 mm: add kernel_misc_reclaimable in show_free_areas

print NR_KERNEL_MISC_RECLAIMABLE stat from show_free_areas to check whether shrinker work correctly and current mem usage.

---
 mm/page_alloc.c | 2 ++
 1 file changed, 2 insertions(+)
mm/page_alloc.c +2 -0
index 856b175c15a4..0eb29a56f349 100644
@@ -5904,6 +5904,7 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
 		" unevictable:%lu dirty:%lu writeback:%lu\n"
 		" slab_reclaimable:%lu slab_unreclaimable:%lu\n"
 		" mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n"
+		" kernel_misc_reclaimable:%lu\n"
 		" free:%lu free_pcp:%lu free_cma:%lu\n",
 		global_node_page_state(NR_ACTIVE_ANON),
 		global_node_page_state(NR_INACTIVE_ANON),
@@ -5920,6 +5921,7 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
 		global_node_page_state(NR_SHMEM),
 		global_node_page_state(NR_PAGETABLE),
 		global_zone_page_state(NR_BOUNCE),
+		global_node_page_state(NR_KERNEL_MISC_RECLAIMABLE),
 		global_zone_page_state(NR_FREE_PAGES),
 		free_pcp,
 		global_zone_page_state(NR_FREE_CMA_PAGES));
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 2 lines · On Fri, 13 Aug 2021 18:47:25 +0800 liuhailong <[email protected]> wrote:

print NR_KERNEL_MISC_RECLAIMABLE stat from show_free_areas to check whether shrinker work correctly and current mem usage.

What inspired this change? Are you observing problems with misc_reclaimable memory accumulation?

#2 lore raw

On 8/14/2021 4:13 AM, Andrew Morton wrote:

On Fri, 13 Aug 2021 18:47:25 +0800 liuhailong <[email protected]><mailto:[email protected]> wrote:

print NR_KERNEL_MISC_RECLAIMABLE stat from show_free_areas to check whether shrinker work correctly and current mem usage.

What inspired this change? Are you observing problems with misc_reclaimable memory accumulation?

1. although we can get usage from /proc/meminfo, but sometimes we only get kernel msg, so we need this to check memusage
2. some drivers use it, like dma heap page pool or gpu driver mem pool, so it also help us to find whether shrinker work correctly on lowmem condition
3. i thought it's resonable for show_free_areas to print misc_recliamiable

author
#3 lore raw
In reply to Andrew Morton
Quoted 7 lines · Andrew Morton
Quoted 2 lines · On Fri, 13 Aug 2021 18:47:25 +0800 liuhailong <[email protected]> wrote:

print NR_KERNEL_MISC_RECLAIMABLE stat from show_free_areas to check whether shrinker work correctly and current mem usage.

What inspired this change? Are you observing problems with misc_reclaimable memory accumulation?

1. although we can get usage from /proc/meminfo, but sometimes we only get kernel msg, so we need this to check memusage
2. some drivers use it, like dma heap page pool or gpu driver mem pool, so it also help us to find whether shrinker work correctly on lowmem condition
3. i thought it's resonable for show_free_areas to print misc_recliamiable