linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	damon@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, kernel-team@meta.com
Subject: Re: [PATCH] mm/damon/paddr: Improve readability of damon_pa_stat
Date: Mon, 13 Jan 2025 13:25:36 -0800	[thread overview]
Message-ID: <20250113212536.39564-1-sj@kernel.org> (raw)
In-Reply-To: <20250113210201.446051-1-joshua.hahnjy@gmail.com>

On Mon, 13 Jan 2025 13:01:56 -0800 Joshua Hahn <joshua.hahnjy@gmail.com> wrote:

> damon_pa_stat contains an unnecessary goto statement, and the if/else
> can be re-written to be more readable.

Thank you for this nice patch!

Seems this patch conflicts with Usama's patch[1], though.  I believe Andrew
could resolve it on his own, but please let me know if any action is needed.

> 
> This patch is written on top of SJ's patch series [1], which in turn is
> written on top of another one of his series [2].
> 
> Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com>

Reviewed-by: SeongJae Park <sj@kernel.org>

> 
> [1] https://lore.kernel.org/all/20241219040327.61902-1-sj@kernel.org/
> [2] https://lore.kernel.org/all/20241213215306.54778-1-sj@kernel.org/

I think 'Signed-off-by:' like tags are the last part of canonical patch
format[2].  Above two links may better to be placed before the tags paragraph
if this patch has a chance to be revised.

[1] https://lore.kernel.org/20250113190738.1156381-1-usamaarif642@gmail.com
[2] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format

> 
> ---
>  mm/damon/paddr.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index b0c283808ba6..8cdf8320f9a5 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -509,11 +509,8 @@ static unsigned long damon_pa_stat(struct damon_region *r, struct damos *s,
>  		if (!folio)
>  			continue;
>  
> -		if (damos_pa_filter_out(s, folio))
> -			goto put_folio;
> -		else
> +		if (!damos_pa_filter_out(s, folio))
>  			*sz_filter_passed += folio_size(folio);
> -put_folio:
>  		folio_put(folio);
>  	}
>  	return 0;
> 
> base-commit: 2c0573ae5b4c9c0f9d81fa0138ed0014e1baf41b
> -- 
> 2.43.5


      reply	other threads:[~2025-01-13 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 21:01 Joshua Hahn
2025-01-13 21:25 ` SeongJae Park [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=20250113212536.39564-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=joshua.hahnjy@gmail.com \
    --cc=kernel-team@meta.com \
    --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