Thread (114 messages) flat view 114 messages, 9 authors, 2026-06-05

Re: [PATCH mm-unstable v18 06/14] mm/khugepaged: generalize collapse_huge_page for mTHP collapse

From: Lance Yang <lance.yang@linux.dev>
Date: 2026-06-01 16:08:03
Also in: linux-doc, linux-mm, lkml


On 2026/6/1 23:05, David Hildenbrand (Arm) wrote:
On 6/1/26 17:00, Nico Pache wrote:
quoted
On Mon, Jun 1, 2026 at 5:14 AM David Hildenbrand (Arm) [off-list ref] wrote:
quoted
On 6/1/26 12:47, Lance Yang wrote:
quoted


Ah, cool! __folio_mark_uptodate() already does the job :P

So yeah, no extra smp_wmb() needed here!
Yeah. BTW, I think we'd need a spin_lock_nested(), so @Nico, treat my code as a
draft.
Okay, I read the above and did some investigating.

I will try to implement and verify the changes you suggested :)

Or an even crazier idea... what if we ensure MIPS checks for PMD_none
before walking a PTE table?
But how would they update the cache then correctly?

I'm too non-MIPS to know the answer :)
Right, that's my concern as well ...

If MIPS sees pmd_none(), it has no PTE table to walk, so it also has
no way to do the cache update it wanted to do, I guess :)

But, the PTE table is not really gone there. khugepaged only cleared
the PMD temporarily while still using the old PTE table through _pmd.

So I'd go with David's suggestion:

"
Best to make sure the page table is already installed when updating
the entries.
"

Cheers, Lance
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help