When split_huge_pte() has been called on the address, which is not THP
aligned, the pte ptr should also be adjusted to the beginning of the THP
page.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Idf1ddf95b3f5a5a790fd2b0eb85ac4c22e561a48
{
spinlock_t *ptl;
struct mmu_notifier_range range;
- pte_t _pte;
+ pte_t _pte, *hpte;
bool locked = false;
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm,
clear_page_mlock(page);
} else if (!(pte_devmap(*pte) || is_pte_migration_entry(*pte)))
goto out;
- __split_huge_pte_locked(vma, pte, range.start, freeze);
+
+ hpte = pte_offset_map(pmd, range.start);
+ VM_BUG_ON(!pte_present(*hpte) || !pte_cont(*hpte));
+ __split_huge_pte_locked(vma, hpte, range.start, freeze);
+ pte_unmap(hpte);
out:
spin_unlock(ptl);
if (locked && page)