Re: [PATCH mm-unstable v18 06/14] mm/khugepaged: generalize collapse_huge_page for mTHP collapse
From: David Hildenbrand (Arm)
Date: Mon Jun 01 2026 - 06:35:56 EST
On 6/1/26 10:44, Lance Yang wrote:
>
>
> On 2026/6/1 16:15, David Hildenbrand (Arm) wrote:
>> On 6/1/26 09:49, Lance Yang wrote:
>>>
>>>
>>>
>>> I had Codex do the boring grep-work through the arch update_mmu_cache*
>>> code :D
>>>
>>> MIPS doesn't seem to be the only code doing a re-walk, but it is the
>>> only one I found that appears to assume the PMD/PTE walk cannot fail,
>>> without checking whether the PMD is none ...
>>
>> Okay, but likely the other code that tries to handle it is also problematic.
>>
>> Best to make sure the page table is already installed when updating the entries.
>
> Neat, makes sense to me :D
>
> That way the page talbe is back in place before any arch hook gets to look at it :)
Right. I don't think we could run into a deadlock here (nobody should
concurrently take a look at the page tables in the first place).
Not sure about the memory barrier I dropped: the page tables are already
properly set up (just some entries cleared), so I'd assume that barrier might
not be required.
--
Cheers,
David