linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Hao Ge <hao.ge@linux.dev>, Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Hao Ge <gehao@kylinos.cn>
Subject: Re: [PATCH] mm/vmscan: Modify the assignment logic of the scan and total_scan variables
Date: Thu, 17 Apr 2025 15:05:14 +0530	[thread overview]
Message-ID: <c655ec08-1adc-4c50-878a-bdc6445875b7@arm.com> (raw)
In-Reply-To: <20250417092422.1333620-1-hao.ge@linux.dev>



On 17/04/25 2:54 pm, Hao Ge wrote:
> From: Hao Ge <gehao@kylinos.cn>
> 
> The scan and total_scan variables can be initialized to 0
> when they are defined, replacing the separate assignment statements.
> 
> Signed-off-by: Hao Ge <gehao@kylinos.cn>

Acked-by: Dev Jain <dev.jain@arm.com>

> ---
>   mm/vmscan.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index b620d74b0f66..bf360ac4f1cf 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1725,13 +1725,11 @@ static unsigned long isolate_lru_folios(unsigned long nr_to_scan,
>   	unsigned long nr_taken = 0;
>   	unsigned long nr_zone_taken[MAX_NR_ZONES] = { 0 };
>   	unsigned long nr_skipped[MAX_NR_ZONES] = { 0, };
> -	unsigned long skipped = 0;
> -	unsigned long scan, total_scan, nr_pages;
> +	unsigned long skipped = 0, total_scan = 0, scan = 0;
> +	unsigned long nr_pages;
>   	unsigned long max_nr_skipped = 0;
>   	LIST_HEAD(folios_skipped);
>   
> -	total_scan = 0;
> -	scan = 0;
>   	while (scan < nr_to_scan && !list_empty(src)) {
>   		struct list_head *move_to = src;
>   		struct folio *folio;



      reply	other threads:[~2025-04-17  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17  9:24 Hao Ge
2025-04-17  9:35 ` Dev Jain [this message]

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=c655ec08-1adc-4c50-878a-bdc6445875b7@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=gehao@kylinos.cn \
    --cc=hao.ge@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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