函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-27 16:07:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:zap_pte_range

函数原型:static unsigned long zap_pte_range(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, struct zap_details *details)

返回类型:unsigned long

参数:

类型参数名称
struct mmu_gather *tlb
struct vm_area_struct *vma
pmd_t *pmd
unsigned longaddr
unsigned longend
struct zap_details *details
1027  mm等于mm
1028  force_flush等于0
1035  tlb_change_page_size(tlb, PAGE_SIZE)
1036  again :
1037  init_rss_vec(rss)
1038  start_pte等于pte_offset_map_lock(mm, pmd, addr, & ptl)
1039  pte等于start_pte
1040  flush_tlb_batched_pending(mm)
1041  A facility to provide lazy MMU batching()
1042  循环
1043  ptent等于pte
1044  如果pte_none(ptent)则继续下一循环
1047  如果need_resched()则退出
1050  如果pte_present(ptent)则
1067  如果此条件成立可能性小(为编译器优化)(!page)则继续下一循环
1070  如果非PageAnon(page)则
1079  rss[mm_counter(page)]自减
1080  page_remove_rmap(page, false)
1084  force_flush等于1
1085  addr加等于PAGE_SIZE
1086  退出
1088  继续下一循环
1091  entry等于Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
1107  rss[mm_counter(page)]自减
1108  page_remove_rmap(page, false)
1109  put_page(page)
1110  继续下一循环
1114  如果此条件成立可能性小(为编译器优化)(details)则继续下一循环
1117  如果非non_swap_entry(entry)则rss[MM_SWAPENTS]自减
1119  否则如果is_migration_entry(entry)则
1123  rss[mm_counter(page)]自减
1125  如果此条件成立可能性小(为编译器优化)(!free_swap_and_cache(entry))则This function is called to print an error when a bad pte* is found. For example, we might have a PFN-mapped pte in* a region that doesn't allow it.* The calling function must still handle the error.
1127  Some architectures may be able to avoid expensive synchronization* primitives when modifications are made to PTE's which are already* not present, or in the process of an address space destruction.
1128 pte自加, addr加等于PAGE_SIZE, addr不等于end循环
1130  add_mm_rss_vec(mm, rss)
1131  arch_leave_lazy_mmu_mode()
1134  如果force_flushtlb_flush_mmu_tlbonly(tlb)
1136  pte_unmap_unlock(start_pte, ptl)
1144  如果force_flush
1145  force_flush等于0
1146  tlb_flush_mmu(tlb)
1149  如果addr不等于end
1150  cond_resched()
1151  转到:again
1154  返回:addr
调用者
名称描述
zap_pmd_range