mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mani Tofigh <mt4022@columbia.edu>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>,
	Nhat Pham <nphamcs@gmail.com>, Baoquan He <baoquan.he@linux.dev>,
	Barry Song <baohua@kernel.org>,
	Youngjun Park <youngjun.park@lge.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	tz2294@columbia.edu, stable@vger.kernel.org
Subject: Re: [PATCH] mm/swapfile: drop a large unmapped swap-in folio in unuse_pte()
Date: Sun, 1 Nov 2026 10:46:11 -0500	[thread overview]
Message-ID: <930e2b99-df87-4aeb-88d0-d12d012edbf1@columbia.edu> (raw)
In-Reply-To: <04ad7001-bdd4-47e1-9a80-5b2464da1044@kernel.org>

On 10/30/26 6:15 PM, David Hildenbrand (Arm) wrote:
> Why is this special to large folios? I guess because a single PTE keeps the
> large folio alive, right?

Yup. For a small folio the one PTE maps all of it so
folio_add_new_anon_rmap() is fine there. For a larger one it marks
every page as mapped and exclusive even though only one PTE got mapped.

> Can you pack the existing handling in do_swap_page() into a helper, pass
> nr_pages, and reuse it here?
Sounds good, I'll do that in v2 and send it against mm/core.git
for-next.  One small thing in the helper you suggested though:
the first check should be folio_test_anon() instead of
!folio_test_anon(), otherwise a large non-anon folio would
still get mapped.

Thanks!
Mani

  reply	other threads:[~2026-11-01 15:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 19:11 Mani Tofigh via B4 Relay
2026-10-30 22:15 ` David Hildenbrand (Arm)
2026-11-01 15:46   ` Mani Tofigh [this message]
2026-11-02  6:53     ` David Hildenbrand (Arm)
2026-10-30 22:54 ` Andrew Morton
2026-10-31  5:54   ` Kairui Song
2026-11-01 15:54     ` Mani Tofigh
2026-10-31  9:34   ` David Hildenbrand (Arm)
2026-10-31  5:54 ` 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=930e2b99-df87-4aeb-88d0-d12d012edbf1@columbia.edu \
    --to=mt4022@columbia.edu \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baoquan.he@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=david@kernel.org \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=shikemeng@huaweicloud.com \
    --cc=stable@vger.kernel.org \
    --cc=tz2294@columbia.edu \
    --cc=youngjun.park@lge.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

all inboxes | Powered by JetHome®