From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Mani Tofigh <mt4022@columbia.edu>,
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: Mon, 2 Nov 2026 07:53:39 +0100 [thread overview]
Message-ID: <4211a96c-681c-4b87-8094-4f6c824ffbbf@kernel.org> (raw)
In-Reply-To: <930e2b99-df87-4aeb-88d0-d12d012edbf1@columbia.edu>
On 11/1/26 16:46, Mani Tofigh wrote:
> 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.
Was just a quick hack to se what we could do with the function name. With the
VM_WARN_ON_ONCE() we might also just move the folio-swapbache dropping to the
caller, leaving the VM_WARN_ON_ONCE() check in there.
Yes, please resend against core.git, thanks!
--
Cheers,
David
next prev parent reply other threads:[~2026-11-02 6:53 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
2026-11-02 6:53 ` David Hildenbrand (Arm) [this message]
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=4211a96c-681c-4b87-8094-4f6c824ffbbf@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chrisl@kernel.org \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mt4022@columbia.edu \
--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®