Re: [PATCH v2 00/16] mm: remove is_swap_[pte, pmd]() + non-swap entries, introduce leaf entries
From: Lorenzo Stoakes
Date: Tue Nov 11 2025 - 02:11:50 EST
On Tue, Nov 11, 2025 at 12:16:51PM +0800, Kairui Song wrote:
> On Tue, Nov 11, 2025 at 8:09 AM Hugh Dickins <hughd@xxxxxxxxxx> wrote:
> > On Mon, 10 Nov 2025, Lorenzo Stoakes wrote:
> > > On Mon, Nov 10, 2025 at 03:04:48AM -0800, Chris Li wrote:
> > > >
> > > > That is actually the reason to give the swap table change more
> > > > priority. Just saying.
> > >
> > > I'm sorry but this is not a reasonable request. I am being as empathetic and
> > > kind as I can be here, but this series is proceeding without arbitrary delay.
> > >
> > > I will do everything I can to accommodate any concerns or issues you may have
> > > here _within reason_ :)
> >
> > But Lorenzo, have you even tested your series properly yet, with
> > swapping and folio migration and huge pages and tmpfs under load?
> > Please do.
> >
> > I haven't had time to bisect yet, maybe there's nothing more needed
> > than a one-liner fix somewhere; but from my experience it is not yet
> > ready for inclusion in mm and next - it stops testing other folks' work.
> >
> > I haven't tried today's v3, but from the cover letter of differences,
> > it didn't look like much of importance is fixed since v2: which
> > (after a profusion of "Bad swap offet entry 3ffffffffffff" messages,
>
> I also noticed the 0x3fff... issue in V2:
> https://lore.kernel.org/all/CAMgjq7AP383YfU3L5ZxJ9U3x-vRPnEkEUtmnPdXD29HiNC8OrA@xxxxxxxxxxxxxx/
>
> The issue is caused by removing the pte_none check, that could result
> in issues like this, so that check has to stay I think, at least for
> the swap part.
>
> It seems V3 has fixed it, I can have a try later.
It does fix it, it was not only the pte_none() thing, also the swap logic has a
totally insane 'let's pretend a PTE none entry is a swap entry' function. Ahem.
I think somewhat forgiveable to miss that :)
>
> I also hope we can keep the swap entry part untouched, Overloading
> swap entry for things like migration looks odd indeed, but setting and
> getting a PTE as swap entry seems clean and easy to understand.
Not completely untouched, as swap logic interacts inevitably with soft leaves -
you might have a softleaf in the page table entry.
But I do intend to keep swp_entry_t for actual swap stuff as discussed with
Chris.
> Existing usage of swap entries is quite logically consistent and
> stable, we might need to do some cleanup for swap but having a
> standalone type and define is very helpful.
I'm not sure how incredibly consistent or beautiful it is looking at the swap
code :) but I don't desire to churn for the sake of it and have no intent other
than doing the minimum there.
Thanks, Lorenzo