函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:follow_pmd_mask

函数原型:static struct page *follow_pmd_mask(struct vm_area_struct *vma, unsigned long address, pud_t *pudp, unsigned int flags, struct follow_page_context *ctx)

返回类型:struct page

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddress
pud_t *pudp
unsigned intflags
struct follow_page_context *ctx
316  mm等于The address space we belong to.
318  pmd等于pmd_offset(pudp, address)
323  pmdval等于READ_ONCE( * pmd)
324  如果pmd_none(pmdval)则返回:no_page_table(vma, flags)
326  如果pmd_huge(pmdval)且Flags, see mm.h. 按位与Huge TLB Page VM
327  page等于follow_huge_pmd(mm, address, pmd, flags)
328  如果page则返回:page
330  返回:no_page_table(vma, flags)
332  如果is_hugepd(__hugepd(pmd_val(pmdval)))则
333  page等于follow_huge_pd(vma, address, __hugepd(pmd_val(pmdval)), flags, PMD_SHIFT)
336  如果page则返回:page
338  返回:no_page_table(vma, flags)
340  retry :
341  如果非pmd_present(pmdval)则
342  如果此条件成立可能性大(为编译器优化)(!(flags & wait for page to replace migration entry ))则返回:no_page_table(vma, flags)
344  VM_BUG_ON(thp_migration_supported() && !is_pmd_migration_entry(pmdval))
346  如果is_pmd_migration_entry(pmdval)则pmd_migration_entry_wait(mm, pmd)
348  pmdval等于READ_ONCE( * pmd)
353  如果pmd_none(pmdval)则返回:no_page_table(vma, flags)
355  转到:retry
357  如果pmd_devmap(pmdval)则
358  ptl等于pmd_lock(mm, pmd)
359  page等于follow_devmap_pmd(vma, address, pmd, flags, & pgmap)
360  自旋锁解锁
361  如果page则返回:page
364  如果此条件成立可能性大(为编译器优化)(!pmd_trans_huge(pmdval))则返回:follow_page_pte(vma, address, pmd, flags, & pgmap)
367  如果flags按位与rce NUMA hinting page fault pmd_protnone(pmdval)则返回:no_page_table(vma, flags)
370  retry_locked :
371  ptl等于pmd_lock(mm, pmd)
372  如果此条件成立可能性小(为编译器优化)(pmd_none( * pmd))则
373  自旋锁解锁
374  返回:no_page_table(vma, flags)
376  如果此条件成立可能性小(为编译器优化)(!pmd_present( * pmd))则
377  自旋锁解锁
378  如果此条件成立可能性大(为编译器优化)(!(flags & wait for page to replace migration entry ))则返回:no_page_table(vma, flags)
380  pmd_migration_entry_wait(mm, pmd)
381  转到:retry_locked
383  如果此条件成立可能性小(为编译器优化)(!pmd_trans_huge( * pmd))则
384  自旋锁解锁
385  返回:follow_page_pte(vma, address, pmd, flags, & pgmap)
387  如果flags按位与don't return transhuge pages, split them 按位或split huge pmd before returning 的值则
389  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:( * pmd)
390  如果is_huge_zero_page(page)则
392  ret等于0
396  否则如果flags按位与don't return transhuge pages, split them
399  返回:错误号
403  ret等于split_huge_page(page)
405  put_page(page)
406  如果pmd_none( * pmd)则返回:no_page_table(vma, flags)
408  否则
411  ret等于如果pte_alloc(mm, pmd)则负ENOMEM否则0
414  返回:如果ret错误号否则follow_page_pte(vma, address, pmd, flags, & pgmap)
417  page等于follow_trans_huge_pmd(vma, address, pmd, flags)
418  自旋锁解锁
419  page_mask等于HPAGE_PMD_NR减1
420  返回:page
调用者
名称描述
follow_pud_mask