entry = pte_mkwrite(pte_mkdirty(entry)); page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (!pte_none(*page_table)) goto release; inc_mm_counter(mm, anon_rss); page_add_new_anon_rmap(page, vma, address);//建立线性区和匿名页的反向映射 setpte: set_pte_at(mm, a...
vma->vm_page_prot)); page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (!pte_none(*page_table)) goto unlock; goto setpte; } /*如果是写操作,则要分配一个新的页*/ /* Allocate our own private page. */ if (unlikely(anon_vma_prepare(vma)))//分配一个anon_vma实例 ...
* Re-check the pte - we dropped the lock */ page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (likely(pte_same(*page_table, orig_pte))) { if (old_page) { if (!PageAnon(old_page)) { dec_mm_counter(mm, file_rss); inc_mm_counter(mm, anon_rss); } }else ...
* Re-check the pte - we dropped the lock */ page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (likely(pte_same(*page_table, orig_pte))) { if (old_page) { if (!PageAnon(old_page)) { dec_mm_counter(mm, file_rss); inc_mm_counter(mm, anon_rss); } } else...
page_table = pte_offset_map_lock(mm, pmd, address, &ptl); if (!pte_same(*page_table, orig_pte)) { unlock_page(old_page); page_cache_release(old_page); goto unlock; } page_cache_release(old_page); } /*确定没有其他进程竞争,则进行reuse判断,通过reuse_swap_page()函数判断 ...
pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address, &vmf->ptl); ->pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(address); 1. 2. 3.
return pte_offset_huge(pmd, addr); } void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, void __set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t entry) { unsigned int nptes, orig_shift, shift; @@ -364,6 +364,12 @@ void set_huge_...
{ -+ status = "okay"; -+ -+ switch_cpu_bmp = <0x1>; /* cpu port bitmap */ -+ switch_lan_bmp = <0x3e>; /* lan port bitmap */ -+ switch_wan_bmp = <0x40>; /* wan port bitmap */ -+ switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ -+ switch_...
*/int__map_syscall32(struct mm_struct *mm,unsignedlongaddress) {pgd_t*pgd;pud_t*pud;pte_t*pte;pmd_t*pmd;interr = -ENOMEM; spin_lock(&mm->page_table_lock); pgd = pgd_offset(mm, address); pud = pud_alloc(mm, pgd, address);if(pud) { ...
1. pte_offset_map_ro_nolock() 2. pte_offset_map_rw_nolock() As the name suggests, pte_offset_map_ro_nolock() is used for read-only case. In this case, only read-only operations will be performed on PTE page after the PTL is held. The RCU lock in pte_offset_map_nolock() ...