All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: add kernel_misc_reclaimable in show_free_areas
@ 2021-08-13 10:47 liuhailong
  2021-08-13 20:13 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: liuhailong @ 2021-08-13 10:47 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, liuhailong

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

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

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 856b175c15a4..0eb29a56f349 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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));
-- 
2.17.1


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

* Re: [PATCH] mm: add kernel_misc_reclaimable in show_free_areas
  2021-08-13 10:47 [PATCH] mm: add kernel_misc_reclaimable in show_free_areas liuhailong
@ 2021-08-13 20:13 ` Andrew Morton
  2021-08-14  7:11   ` 刘海龙(DuckBuBee)
  2021-08-15  4:44   ` liuhailong
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2021-08-13 20:13 UTC (permalink / raw)
  To: liuhailong; +Cc: linux-mm, linux-kernel

On Fri, 13 Aug 2021 18:47:25 +0800 liuhailong <liuhailong@oppo.com> 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?

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

* Re: [PATCH] mm: add kernel_misc_reclaimable in show_free_areas
  2021-08-13 20:13 ` Andrew Morton
@ 2021-08-14  7:11   ` 刘海龙(DuckBuBee)
  2021-08-15  4:44   ` liuhailong
  1 sibling, 0 replies; 4+ messages in thread
From: 刘海龙(DuckBuBee) @ 2021-08-14  7:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

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

On Fri, 13 Aug 2021 18:47:25 +0800 liuhailong <liuhailong@oppo.com><mailto:liuhailong@oppo.com> 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

[-- Attachment #2: Type: text/html, Size: 1231 bytes --]

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

* Re: [PATCH] mm: add kernel_misc_reclaimable in show_free_areas
  2021-08-13 20:13 ` Andrew Morton
  2021-08-14  7:11   ` 刘海龙(DuckBuBee)
@ 2021-08-15  4:44   ` liuhailong
  1 sibling, 0 replies; 4+ messages in thread
From: liuhailong @ 2021-08-15  4:44 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, linux-mm, liuhailong

On 8/14/2021 4:13 AM, Andrew Morton wrote:
> On Fri, 13 Aug 2021 18:47:25 +0800 liuhailong <liuhailong@oppo.com> 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

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

end of thread, other threads:[~2021-08-15  5:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 10:47 [PATCH] mm: add kernel_misc_reclaimable in show_free_areas liuhailong
2021-08-13 20:13 ` Andrew Morton
2021-08-14  7:11   ` 刘海龙(DuckBuBee)
2021-08-15  4:44   ` liuhailong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.