函数逻辑报告 |
Source Code:mm\memory.c |
Create Date:2022-07-27 16:09:48 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:We enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases
函数原型:vm_fault_t do_swap_page(struct vm_fault *vmf)
返回类型:vm_fault_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct vm_fault * | vmf |
2904 | vma等于Target VMA |
2910 | exclusive等于0 |
2911 | ret等于0 |
2913 | 如果非handle_pte_fault chooses page fault handler according to an entry which was* read non-atomically则转到:out |
2916 | entry等于Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t. |
2917 | 如果此条件成立可能性小(为编译器优化)(non_swap_entry(entry))则 |
2918 | 如果is_migration_entry(entry)则 |
2921 | 否则如果is_device_private_entry(entry)则 |
2922 | ->fault handlers should return a* page here, unless VM_FAULT_NOPAGE* is set (which is also implied by* VM_FAULT_ERROR).等于device_private_entry_to_page(entry) |
2923 | ret等于migrate_to_ram(vmf) |
2924 | 否则如果is_hwpoison_entry(entry)则 |
2925 | ret等于VM_FAULT_HWPOISON |
2926 | 否则 |
2928 | ret等于VM_FAULT_SIGBUS |
2930 | 转到:out |
2935 | page等于lookup_swap_cache(entry, vma, Faulting virtual address ) |
2938 | 如果非page则 |
2939 | si等于swp_swap_info(entry) |
2941 | 如果SWP_USED etc: see above 按位与SWP_SYNCHRONOUS_IO且__swap_count(entry)恒等于1则 |
2946 | 如果page则 |
2947 | __SetPageLocked(page) |
2948 | __SetPageSwapBacked(page) |
2949 | set_page_private(page, val) |
2951 | swap_readpage(page, true) |
2953 | 否则 |
2954 | page等于swapin_readahead(entry, GFP_HIGHUSER_MOVABLE, vmf) |
2959 | 如果非page则 |
2966 | 如果此条件成立可能性大(为编译器优化)(pte_same( * Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., Value of PTE at the time of fault ))则ret等于VM_FAULT_OOM |
2969 | 转到:unlock |
2973 | ret等于VM_FAULT_MAJOR |
2974 | Disable counters |
2976 | 否则如果PageHWPoison(page)则 |
2989 | 如果非locked则 |
2990 | ret或等于VM_FAULT_RETRY |
2991 | 转到:out_release |
3000 | 如果此条件成立可能性小(为编译器优化)((!PageSwapCache(page) || page_private(page) != val))且swapcache则转到:out_page |
3005 | 如果此条件成立可能性小(为编译器优化)(!page)则 |
3011 | 如果mem_cgroup_try_charge_delay(page, The address space we belong to. , GFP_KERNEL, & memcg, false)则 |
3013 | ret等于VM_FAULT_OOM |
3014 | 转到:out_page |
3022 | 如果此条件成立可能性小(为编译器优化)(!pte_same( * Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., Value of PTE at the time of fault ))则转到:out_nomap |
3025 | 如果此条件成立可能性小(为编译器优化)(!PageUptodate(page))则 |
3026 | ret等于VM_FAULT_SIGBUS |
3027 | 转到:out_nomap |
3043 | 如果FAULT_FLAG_xxx flags 按位与Fault was a write access 且reuse_swap_page(page, NULL)则 |
3045 | FAULT_FLAG_xxx flags 与等于Fault was a write access 的反 |
3046 | ret或等于VM_FAULT_WRITE |
3049 | flush_icache_page(vma, page) |
3052 | set_pte_at(The address space we belong to. , Faulting virtual address , Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., pte) |
3057 | 如果此条件成立可能性小(为编译器优化)(page != swapcache && swapcache)则 |
3058 | page_add_new_anon_rmap(page, vma, Faulting virtual address , false) |
3061 | 否则 |
3063 | mem_cgroup_commit_charge(page, memcg, true, false) |
3064 | activate_page(page) |
3068 | 如果mem_cgroup_swap_full(page)或Flags, see mm.h. 按位与VM_LOCKED或PageMlocked(page)则try_to_free_swap(page) |
3085 | 如果FAULT_FLAG_xxx flags 按位与Fault was a write access 则 |
3087 | 如果ret按位与VM_FAULT_ERROR则ret与等于VM_FAULT_ERROR |
3089 | 转到:out |
3094 | unlock : |
3095 | pte_unmap_unlock(Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., Page table lock.* Protects pte page table if 'pte'* is not NULL, otherwise pmd.) |
3096 | out : |
3097 | 返回:ret |
3098 | out_nomap : |
3099 | mem_cgroup_cancel_charge(page, memcg, false) |
3100 | pte_unmap_unlock(Pointer to pte entry matching* the 'address'. NULL if the page* table hasn't been allocated., Page table lock.* Protects pte page table if 'pte'* is not NULL, otherwise pmd.) |
3101 | out_page : |
3103 | out_release : |
3109 | 返回:ret |
名称 | 描述 |
---|---|
handle_pte_fault | These routines also need to handle stuff like marking pages dirty* and/or accessed for architectures that don't do it in hardware (most* RISC architectures) |
__collapse_huge_page_swapin | Bring missing pages in from swap, to complete THP collapse.* Only done if khugepaged_scan_pmd believes it is worthwhile.* Called and returns without pte mapped or spinlocks held,* but with mmap_sem held to protect against vma changes. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |