Re: [RFC 01/12] mm: add PUD THP ptdesc and rmap support

From: David Hildenbrand (Arm)

Date: Thu Feb 05 2026 - 12:41:04 EST


On 2/5/26 06:13, Usama Arif wrote:


On 04/02/2026 20:21, Matthew Wilcox wrote:
On Thu, Feb 05, 2026 at 04:17:19AM +0000, Matthew Wilcox wrote:
Why are you even talking about "the next series"? The approach is
wrong. You need to put this POC aside and solve the problems that
you've bypassed to create this POC.


Ah is the issue the code duplication that Lorenzo has raised (ofcourse
completely agree that there is quite a bit), the lru.next patch I did
which hopefully [1] makes better, or investigating if it might be
interferring with DAX/VFIO that Lorenzo pointed out (will ofcourse
investigate before sending the next revision)? The mapcount work
(I think David is working on this?) that is needed to allow splitting
PUDs to PMD is completely a separate issue and can be tackled in parallel
to this.

I would enjoy seeing an investigation where we see what might have to be done to avoid preallocating page tables for anonymous memory THPs, and instead, try allocating them on demand when remapping. If allocation fails, it's just another -ENOMEM or -EAGAIN.

That would not only reduce the page table overhead when using THPs, it would also avoid the preallocation of two levels like you need here.

Maybe it's doable, maybe not.

Last time I looked into it I was like "there must be a better way to achieve that" :)

Spinlocks might require preallocating etc.

(as raised elsewhere, staring with shmem support avoid the page table problem)



... and gmail is rejecting this email as being spam. You need to stop
using gmail for kernel deveopment work.

I asked a couple of folks now and it seems they got it without any issue.
I have used it for a long time. I will try and see if something has changed.

Gmail is absolutely horrible for upstream development. For example, linux-mm recently un-subscribed all gmail addresses.

When I moved to my kernel.org address I thought using gmail as a backend would be a great choice. I was wrong and after getting daily bounce notifications from MLs (even though my spamfilter rules essentially allowed everything). So I moved to something else (I now pay 3Euro a month, omg! :) ).

--
Cheers,

David