mbox series

[RFC,v1,0/2] mm, pcp: add high order page info in /proc/zoneinfo

Message ID 20240115093437.87814-1-vernhao@tencent.com (mailing list archive)
Headers show
Series mm, pcp: add high order page info in /proc/zoneinfo | expand

Message

Vern Hao Jan. 15, 2024, 9:34 a.m. UTC
From: Xin Hao <vernhao@tencent.com>

With /proc/zoneinfo we can simply get the number of pages used each cpu,
but we can't get more detailed information about the distribution of
those pages, such as the count of high order pages, through these
patches, we can know the usage of each order page in detail, which will
be helpful for us to analyze the pcp memory usage of application on the
related cpus.

By the way, on my intel 32 cores machine, i found that the 'struct
per_cpu_pages' size increases 64 bytes, it seems like a bad news,
i did some tests like stress-ng, but it did not see any performance
degradation, and maybe use 'pcp->list' is also a possible way to get
high order pages count, but it will increase the /proc/zoneinfo query
time, so any meaningful suggestions are welcome!

Xin Hao (2):
  mm, pcp: rename pcp->count to pcp->total_count
  mm, pcp: add more detail info about high order page count

 include/linux/mmzone.h |  3 ++-
 mm/page_alloc.c        | 46 +++++++++++++++++++++++-------------------
 mm/show_mem.c          |  6 +++---
 mm/vmstat.c            | 22 ++++++++++++--------
 4 files changed, 44 insertions(+), 33 deletions(-)

Comments

David Rientjes Jan. 15, 2024, 8:32 p.m. UTC | #1
On Mon, 15 Jan 2024, Vern Hao wrote:

> From: Xin Hao <vernhao@tencent.com>
> 
> With /proc/zoneinfo we can simply get the number of pages used each cpu,
> but we can't get more detailed information about the distribution of
> those pages, such as the count of high order pages, through these
> patches, we can know the usage of each order page in detail, which will
> be helpful for us to analyze the pcp memory usage of application on the
> related cpus.
> 

Could you elaborate on the use case for this?

I'm not exactly sure what is meant by analyzing the pcp memory usage of an 
application; this would be a property of page allocations and freeing on 
individual cpus for orders that have pcp lists.  That's traditionally not 
a property of an individual application.

> By the way, on my intel 32 cores machine, i found that the 'struct
> per_cpu_pages' size increases 64 bytes, it seems like a bad news,
> i did some tests like stress-ng, but it did not see any performance
> degradation, and maybe use 'pcp->list' is also a possible way to get
> high order pages count, but it will increase the /proc/zoneinfo query
> time, so any meaningful suggestions are welcome!
> 
> Xin Hao (2):
>   mm, pcp: rename pcp->count to pcp->total_count
>   mm, pcp: add more detail info about high order page count
> 
>  include/linux/mmzone.h |  3 ++-
>  mm/page_alloc.c        | 46 +++++++++++++++++++++++-------------------
>  mm/show_mem.c          |  6 +++---
>  mm/vmstat.c            | 22 ++++++++++++--------
>  4 files changed, 44 insertions(+), 33 deletions(-)
> 
> -- 
> 2.31.1
> 
> 
>