#define pmd_dirty(pmd) (pmd_isset((pmd), L_PMD_SECT_DIRTY))//检查 PMD 是否已被修改 #define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd)) #define pmd_thp_or_huge(pmd) (pmd_huge(pmd) || pmd_trans_huge(pmd)) #ifdef CONFIG_TRANSPARENT_HUGEPAGE #define pmd_trans...
err = walk->pmd_entry(pmd, addr, next, walk);if(err)break;/* * Check this here so we only break down trans_huge * pages when we _need_ to */if(!walk->pte_entry)continue; split_huge_page_pmd(walk->mm, pmd);if(pmd_none_or_trans_huge_or_clear_bad(pmd))gotoagain; err = ...
if (pud_trans_huge(orig_pud) || pud_devmap(orig_pud)) { /* NUMA case for anonymous PUDs would go here */ if (dirty && !pud_write(orig_pud)) { ret = wp_huge_pud(&vmf, orig_pud); if (!(ret & VM_FAULT_FALLBACK)) return ret; } else { huge_pud_set_accessed(&vmf, orig...
777 ptl等于pmd_lock(mm, pmd) 778 如果非pmd_none( * pmd)则 779 如果write则 780 如果pmd_pfn( * pmd)不等于pfn_t_to_pfn(pfn)则 781 WARN_ON_ONCE(!is_huge_zero_pmd( * pmd)) 782 转到:out_unlock 784 entry等于pmd_mkyoung( * pmd) 785 entry等于maybe_pmd_mkwrite(pmd_mkdirty...
#ifdef CONFIG_TRANSPARENT_HUGEPAGE #define pmd_trans_huge(pmd) (pmd_val(pmd) && !pmd_table(pmd)) #endif #define PMD_BIT_FUNC(fn,op) \ static inline pmd_t pmd_##fn(pmd_t pmd) { pmd_val(pmd) op; return pmd; } PMD_BIT_FUNC(wrprotect, |= L_PMD_SECT_RDONLY); ...
#ifdef CONFIG_TRANSPARENT_HUGEPAGE #define pmd_trans_huge(pmd) (pmd_val(pmd) && !pmd_table(pmd)) #endif #define PMD_BIT_FUNC(fn,op) \ static inline pmd_t pmd_##fn(pmd_t pmd) { pmd_val(pmd) op; return pmd; } PMD_BIT_FUNC(wrprotect, |= L_PMD_SECT_RDONLY); ...
VM_BUG_ON(pmd_trans_huge(*pmd)); pte = pte_offset_map(pmd, address);if(pte_none(*pte))gotounmap; *vma = get_gate_vma(mm);if(!page)gotoout; *page = vm_normal_page(*vma, address, *pte);if(!*page) {if((gup_flags & FOLL_DUMP) || !is_zero_pfn(pte_pfn(*pte)))gotounm...