linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Luis Chamberlain <mcgrof@kernel.org>,
	akpm@linux-foundation.org, jhubbard@nvidia.com, mgorman@suse.de,
	linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, dave@stgolabs.net,
	p.raghav@samsung.com, da.gomez@samsung.com
Subject: Re: [PATCH 3/3] mm/vmstat: simplfy extfrag_show_print with fragmentation_index()
Date: Fri, 15 Mar 2024 12:13:12 +0100	[thread overview]
Message-ID: <74675841-efdf-4af1-8505-3ad548a34b77@suse.cz> (raw)
In-Reply-To: <20240314005436.2962962-4-mcgrof@kernel.org>

On 3/14/24 01:54, Luis Chamberlain wrote:
> fragmentation_index() already uses the stack for the struct contig_page_info,
> so just use that and enhance the documentation for fragmentation_index().
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Reviewed-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/vmstat.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index db79935e4a54..582f89b37ccf 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1129,7 +1129,10 @@ unsigned int extfrag_for_order(struct zone *zone, unsigned int order)
>  			info.free_pages);
>  }
>  
> -/* Same as __fragmentation index but allocs contig_page_info on stack */
> +/*
> + * Same as __fragmentation index but allocs contig_page_info on stack,
> + * useful when walking a zone as interrupts are disabled.
> + */
>  int fragmentation_index(struct zone *zone, unsigned int order)
>  {
>  	struct contig_page_info info;
> @@ -2227,15 +2230,11 @@ static void extfrag_show_print(struct seq_file *m,
>  	unsigned int order;
>  	int index;
>  
> -	/* Alloc on stack as interrupts are disabled for zone walk */
> -	struct contig_page_info info;
> -
>  	seq_printf(m, "Node %d, zone %8s ",
>  				pgdat->node_id,
>  				zone->name);
>  	for (order = 0; order < NR_PAGE_ORDERS; ++order) {
> -		fill_contig_page_info(zone, order, &info);
> -		index = __fragmentation_index(order, &info);
> +		index = fragmentation_index(zone, order);
>  		seq_printf(m, "%2d.%03d ", index / 1000, index % 1000);
>  	}
>  



  reply	other threads:[~2024-03-15 11:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14  0:54 [PATCH 0/3] mm: random cleanups Luis Chamberlain
2024-03-14  0:54 ` [PATCH 1/3] mm/show_mem: simplify ifdef on si_meminfo_node() Luis Chamberlain
2024-03-14  1:13   ` Kefeng Wang
2024-03-14  0:54 ` [PATCH 2/3] mm/compaction: add and use for_each_populated_zone_pgdat() helper Luis Chamberlain
2024-03-14  7:19   ` Baolin Wang
2024-03-15  5:38     ` Luis Chamberlain
2024-03-15  9:39       ` Baolin Wang
2024-03-15 11:09       ` Vlastimil Babka
2024-03-15 17:48         ` Luis Chamberlain
2024-03-14 11:40   ` kernel test robot
2024-03-14  0:54 ` [PATCH 3/3] mm/vmstat: simplfy extfrag_show_print with fragmentation_index() Luis Chamberlain
2024-03-15 11:13   ` Vlastimil Babka [this message]
2024-03-15 14:36   ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74675841-efdf-4af1-8505-3ad548a34b77@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=da.gomez@samsung.com \
    --cc=dave@stgolabs.net \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=mgorman@suse.de \
    --cc=p.raghav@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox