Re: [PATCH -v2 1/2] mm: add spurious fault fixing support for huge pmd

From: David Hildenbrand

Date: Wed Oct 15 2025 - 08:23:46 EST





_pmd = pmd_mkyoung(*pmd);
if (write)
_pmd = pmd_mkdirty(_pmd);
- if (pmdp_set_access_flags(vma, addr & HPAGE_PMD_MASK,
- pmd, _pmd, write))
+ changed = pmdp_set_access_flags(vma, addr & HPAGE_PMD_MASK,
+ pmd, _pmd, write);
+ if (changed)
update_mmu_cache_pmd(vma, addr, pmd);

We can make this simpler, e.g.:

if (pmdp_set_access_flags(vma, addr & HPAGE_PMD_MASK,
pmd, entry, write)) {
update_mmu_cache_pmd(vma, addr, pmd);
return true;
}

return false;

No problem. As long as David is OK with this.

Sure I don't think he'd have an issue with it but he can raise it if so :)

Absolutely fine :)

--
Cheers

David / dhildenb