Function report |
Source Code:mm\mprotect.c |
Create Date:2022-07-28 14:51:50 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:change_pte_range
Proto:static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, pgprot_t newprot, int dirty_accountable, int prot_numa)
Type:unsigned long
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
pmd_t * | pmd | |
unsigned long | addr | |
unsigned long | end | |
pgprot_t | newprot | |
int | dirty_accountable | |
int | prot_numa |
44 | pages = 0 |
45 | target_node = NUMA_NO_NODE |
53 | If This is a noop if Transparent Hugepage Support is not built into* the kernel Then Return 0 |
61 | pte = pte_offset_map_lock(The address space we belong to. , pmd, addr, & ptl) |
64 | If prot_numa && Not (Flags, see mm.h. & VM_SHARED) && atomic_read( & mm_users) == 1 Then target_node = Returns the number of the current Node. |
70 | Do |
72 | If pte_present(oldpte) Then |
74 | preserve_write = prot_numa && pte_write(oldpte) |
80 | If prot_numa Then |
92 | If is_cow_mapping(Flags, see mm.h. ) && page_mapcount(page) != 1 Then Continue |
108 | If target_node == page_to_nid(page) Then Continue |
112 | oldpte = Start a pte protection read-modify-write transaction, which* protects against asynchronous hardware modifications to the pte |
113 | ptent = pte_modify(oldpte, newprot) |
114 | If preserve_write Then ptent = pte_mk_savedwrite(ptent) |
118 | If dirty_accountable && The following only work if pte_present() is true.* Undefined behaviour if not.. && (pte_soft_dirty(ptent) || Not (Flags, see mm.h. & VM_SOFTDIRTY) ) Then |
121 | ptent = pte_mkwrite(ptent) |
124 | pages++ |
126 | entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t. |
128 | If is_write_migration_entry(entry) Then |
134 | make_migration_entry_read( & entry) |
135 | newpte = Convert the arch-independent representation of a swp_entry_t into the* arch-dependent pte representation. |
136 | If pte_swp_soft_dirty(oldpte) Then newpte = pte_swp_mksoft_dirty(newpte) |
140 | pages++ |
143 | If is_write_device_private_entry(entry) Then |
158 | arch_leave_lazy_mmu_mode() |
159 | pte_unmap_unlock(pte - 1, ptl) |
161 | Return pages |
Name | Describe |
---|---|
change_pmd_range |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |