linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: YoungJun Park <youngjun.park@lge.com>
To: Kairui Song <kasong@tencent.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hughd@google.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Matthew Wilcox <willy@infradead.org>,
	Kemeng Shi <shikemeng@huaweicloud.com>,
	Chris Li <chrisl@kernel.org>, Nhat Pham <nphamcs@gmail.com>,
	Baoquan He <bhe@redhat.com>, Barry Song <baohua@kernel.org>,
	linux-kernel@vger.kernel.org, gunho.lee@lge.com,
	taejoon.song@lge.com
Subject: Re: [PATCH v2 3/4] mm/shmem, swap: improve mthp swapin process
Date: Fri, 20 Jun 2025 16:53:26 +0900	[thread overview]
Message-ID: <aFUTdnPTT6m0GBX0@yjaykim-PowerEdge-T330> (raw)
In-Reply-To: <20250619175538.15799-4-ryncsn@gmail.com>

On Fri, Jun 20, 2025 at 01:55:37AM +0800, Kairui Song wrote:
> +	if (skip_swapcache) {
> +		swapcache_clear(si, folio->swap, folio_nr_pages(folio));
> +		folio->swap.val = 0;
>  	}
> +	if (folio)
> +		folio_put(folio);
>  	put_swap_device(si);
 
I really appreciate the patch. great work!

It's a rather trivial point, but I was wondering if the following change
might make sense:
...
	if (skip_swapcache)
		swapcache_clear(si, folio->swap, folio_nr_pages(folio));

  	put_swap_device(si);

	if (folio)
		folio_put(folio);

	return error;
...

My intention here is to minimize the reference to si,
and from what I understand, this folio has already been allocated and would 
soon disappear. Is it possible to to reduce the clear operation?
(folio->swap.val = 0)

Just a small suggestion.
Thank you again for your work!

Regards,
Youngjun Park


  reply	other threads:[~2025-06-20  7:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19 17:55 [PATCH v2 0/4] mm/shmem, swap: bugfix and improvement of mTHP swap in Kairui Song
2025-06-19 17:55 ` [PATCH v2 1/4] mm/shmem, swap: improve cached mTHP handling and fix potential hung Kairui Song
2025-06-23  3:26   ` Baolin Wang
2025-06-23  3:35     ` Kairui Song
2025-06-23  3:37       ` Kairui Song
2025-06-23  3:38       ` Baolin Wang
2025-06-23  3:40         ` Kairui Song
2025-06-19 17:55 ` [PATCH v2 2/4] mm/shmem, swap: avoid redundant Xarray lookup during swapin Kairui Song
2025-06-20  3:34   ` Dev Jain
2025-06-21  4:27   ` Baolin Wang
2025-06-19 17:55 ` [PATCH v2 3/4] mm/shmem, swap: improve mthp swapin process Kairui Song
2025-06-20  7:53   ` YoungJun Park [this message]
2025-06-22 18:48     ` Kairui Song
2025-06-23  3:37   ` Baolin Wang
2025-06-23  3:39     ` Kairui Song
2025-06-19 17:55 ` [PATCH v2 4/4] mm/shmem, swap: avoid false positive swap cache lookup Kairui Song

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=aFUTdnPTT6m0GBX0@yjaykim-PowerEdge-T330 \
    --to=youngjun.park@lge.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bhe@redhat.com \
    --cc=chrisl@kernel.org \
    --cc=gunho.lee@lge.com \
    --cc=hughd@google.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=shikemeng@huaweicloud.com \
    --cc=taejoon.song@lge.com \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).