| 函数逻辑报告 | 
| Source Code: mm\hugetlb.c | Create Date:2022-07-27 17:01:00 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:hugetlb_fault
函数原型:vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, unsigned int flags)
返回类型:vm_fault_t
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| struct mm_struct * | mm | |
| struct vm_area_struct * | vma | |
| unsigned long | address | |
| unsigned int | flags | 
| 4007 | struct page * pagecache_page = NULL | 
| 4008 | h等于hstate_vma(vma) | 
| 4010 | need_wait_lock等于0 | 
| 4011 | haddr等于address按位与huge_page_mask(h) | 
| 4013 | ptep等于huge_pte_offset(mm, haddr, huge_page_size(h)) | 
| 4014 | 如果ptep则 | 
| 4015 | entry等于huge_ptep_get(ptep) | 
| 4016 | 如果此条件成立可能性小(为编译器优化)(is_hugetlb_entry_migration(entry))则 | 
| 4017 | migration_entry_wait_huge(vma, mm, ptep) | 
| 4018 | 返回:0 | 
| 4022 | 否则 | 
| 4023 | ptep等于arch callbacks | 
| 4024 | 如果非ptep则返回:VM_FAULT_OOM | 
| 4029 | idx等于Convert the address within this vma to the page offset within* the mapping, in pagecache page units; huge pages here. | 
| 4036 | hash等于For uniprocesor systems we always use a single mutex, so just* return 0 and avoid the hashing overhead. | 
| 4037 | mutex_lock( & hugetlb_fault_mutex_table[hash]) | 
| 4039 | entry等于huge_ptep_get(ptep) | 
| 4040 | 如果huge_pte_none(entry)则 | 
| 4045 | ret等于0 | 
| 4054 | 如果非pte_present(entry)则转到:out_mutex | 
| 4065 | 如果flags按位与Fault was a write access 且非huge_pte_write(entry)则 | 
| 4066 | 如果vma_needs_reservation(h, vma, haddr)小于0则 | 
| 4067 | ret等于VM_FAULT_OOM | 
| 4068 | 转到:out_mutex | 
| 4071 | vma_end_reservation(h, vma, haddr) | 
| 4078 | ptl等于huge_pte_lock(h, mm, ptep) | 
| 4081 | 如果此条件成立可能性小(为编译器优化)(!pte_same(entry, huge_ptep_get(ptep)))则转到:out_ptl | 
| 4092 | need_wait_lock等于1 | 
| 4093 | 转到:out_ptl | 
| 4098 | 如果flags按位与Fault was a write access 则 | 
| 4099 | 如果非huge_pte_write(entry)则 | 
| 4102 | 转到:out_put_page | 
| 4104 | entry等于huge_pte_mkdirty(entry) | 
| 4106 | entry等于pte_mkyoung(entry) | 
| 4110 | out_put_page : | 
| 4114 | out_ptl : | 
| 4115 | 自旋锁解锁 | 
| 4117 | 如果pagecache_page则 | 
| 4121 | out_mutex : | 
| 4130 | 如果need_wait_lock则Wait for a page to be unlocked.* This must be called with the caller "holding" the page,* ie with increased "page->count" so that the page won't* go away during the wait.. | 
| 4132 | 返回:ret | 
| 名称 | 描述 | 
|---|---|
| follow_hugetlb_page | |
| handle_mm_fault | By the time we get here, we already hold the mm semaphore* The mmap_sem may have been released depending on flags and our* return value. See filemap_fault() and __lock_page_or_retry(). | 
| 源代码转换工具 开放的插件接口 | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |