Function report |
Source Code:mm\hugetlb.c |
Create Date:2022-07-28 15:29:31 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:hugetlb_change_protection
Proto:unsigned long hugetlb_change_protection(struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot)
Type:unsigned long
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
unsigned long | address | |
unsigned long | end | |
pgprot_t | newprot |
4454 | h = hstate_vma(vma) |
4455 | pages = 0 |
4456 | bool shared_pmd = false |
4464 | mmu_notifier_range_init( & range, MMU_NOTIFY_PROTECTION_VMA, 0, vma, mm, start, end) |
4466 | adjust_range_if_pmd_sharing_possible(vma, & start, & end) |
4469 | flush_cache_range(vma, start, end) |
4471 | mmu_notifier_invalidate_range_start( & range) |
4472 | i_mmap_lock_write(f_mapping) |
4475 | ptep = huge_pte_offset(mm, address, huge_page_size(h)) |
4476 | If Not ptep Then Continue |
4478 | ptl = huge_pte_lock(h, mm, ptep) |
4479 | If huge_pmd_unshare(mm, & address, ptep) Then |
4485 | pte = huge_ptep_get(ptep) |
4487 | spin_unlock(ptl) |
4488 | Continue |
4491 | entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t. |
4493 | If is_write_migration_entry(entry) Then |
4496 | make_migration_entry_read( & entry) |
4497 | newpte = Convert the arch-independent representation of a swp_entry_t into the* arch-dependent pte representation. |
4498 | set_huge_swap_pte_at(mm, address, ptep, newpte, huge_page_size(h)) |
4500 | pages++ |
4502 | spin_unlock(ptl) |
4503 | Continue |
4505 | If Not huge_pte_none(pte) Then |
4508 | old_pte = huge_ptep_modify_prot_start(vma, address, ptep) |
4509 | pte = pte_mkhuge(huge_pte_modify(old_pte, newprot)) |
4510 | pte = arch_make_huge_pte(pte, vma, NULL, 0) |
4512 | pages++ |
4514 | spin_unlock(ptl) |
4523 | If shared_pmd Then ARCHes with special requirements for evicting HUGETLB backing TLB entries can* implement this.(vma, start, end) |
4525 | Else ARCHes with special requirements for evicting HUGETLB backing TLB entries can* implement this.(vma, start, end) |
4533 | i_mmap_unlock_write(f_mapping) |
4534 | mmu_notifier_invalidate_range_end( & 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 |