From: "David Hildenbrand (Arm)" <david@kernel•org>
To: Kevin Brodsky <kevin.brodsky@arm•com>,
Vishal Moola <vishal.moola@gmail•com>,
Catalin Marinas <catalin.marinas@arm•com>
Cc: Andrew Morton <akpm@linux-foundation•org>,
Alistair Popple <apopple@nvidia•com>,
linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org, linux-mm@kvack•org,
will@kernel•org
Subject: Re: [PATCH] arm64: mm: call pagetable dtor when freeing hot-removed page tables
Date: Sun, 31 May 2026 21:29:21 +0200 [thread overview]
Message-ID: <6f6e6998-7dd2-469d-852f-4ff7bbb768b9@kernel.org> (raw)
In-Reply-To: <db11078b-a283-4717-bed2-da56e77c7132@arm.com>
On 5/27/26 09:34, Kevin Brodsky wrote:
> On 26/05/2026 14:31, David Hildenbrand (Arm) wrote:
>> On 5/26/26 13:54, Kevin Brodsky wrote:
>>> Agreed, I think this is the right thing to do, something like:
>>>
>>> if (folio_test_pgtable(page_folio(page)))
>>> pagetable_dtor_free(page_ptdesc(page)); else
>>> free_hotplug_page_range(page, PAGE_SIZE, NULL);
>> That code pattern is wrong.
>>
>> folio_test_pgtable() shouldn't exist.
>>
>> In the future, something is either a pgtable or a folio, not both.
>>
>> So check the type against the page, not the folio.
>
> In other words use PageTable(page) instead? Interestingly I can see a
> few calls to folio_test_pgtable() across the kernel but none to
> PageTable(), maybe just an antipattern then? The ctor/dtor also use
> __folio_{set,clear}_pgtable().
We started running into the wrong direction, and now have to undo all the wrong
things we already did :)
In the current design Willy has in mind, doing a page_folio() will later return
NULL if it's not actually a folio.
--
Cheers,
David
next prev parent reply other threads:[~2026-05-31 19:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 3:27 [PATCH] arm64: mm: call pagetable dtor when freeing hot-removed page tables Alistair Popple
2026-05-21 22:31 ` Andrew Morton
2026-05-21 23:50 ` Alistair Popple
2026-05-22 7:15 ` Catalin Marinas
2026-05-22 7:32 ` Catalin Marinas
2026-05-22 9:36 ` Vishal Moola
2026-05-26 11:54 ` Kevin Brodsky
2026-05-26 12:31 ` David Hildenbrand (Arm)
2026-05-27 7:34 ` Kevin Brodsky
2026-05-27 9:22 ` Vishal Moola
2026-05-31 19:29 ` David Hildenbrand (Arm) [this message]
2026-05-26 15:07 ` Will Deacon
2026-05-27 7:35 ` Kevin Brodsky
2026-05-27 9:30 ` Vishal Moola
2026-05-28 8:05 ` Kevin Brodsky
2026-05-29 10:16 ` Vishal Moola
2026-06-02 4:22 ` Andrew Morton
2026-06-02 13:12 ` Will Deacon
2026-06-02 17:06 ` Andrew Morton
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=6f6e6998-7dd2-469d-852f-4ff7bbb768b9@kernel.org \
--to=david@kernel$(echo .)org \
--cc=akpm@linux-foundation$(echo .)org \
--cc=apopple@nvidia$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=kevin.brodsky@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=vishal.moola@gmail$(echo .)com \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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