函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:khugepaged_scan_mm_slot

函数原型:static unsigned int khugepaged_scan_mm_slot(unsigned int pages, struct page **hpage)__releases(&khugepaged_mm_lock) __acquires(&khugepaged_mm_lock)

返回类型:unsigned int

参数:

类型参数名称
unsigned intpages
struct page **hpage
1928  progress等于0
1930  VM_BUG_ON(!pages)
1931  lockdep_assert_held( & khugepaged_mm_lock)
1933  如果mm_slotmm_slot等于mm_slot
1935  否则
1936  mm_slot等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(链表后项, structmm_slot, mm_node)
1938  address等于0
1939  mm_slot等于mm_slot
1941  自旋锁解锁
1942  khugepaged_collapse_pte_mapped_thps(mm_slot)
1944  mm等于mm
1949  vma = NULL
1950  如果此条件成立可能性小(为编译器优化)(!rylock for reading -- returns 1 if successful, 0 if contention)则转到:breakouterloop_mmap_sem
1952  如果此条件成立可能性大(为编译器优化)(!khugepaged_test_exit(mm))则vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
1955  progress自加
1956 vma循环
1959  cond_resched()
1961  progress自加
1962  退出
1965  :
1966  progress自加
1967  继续下一循环
1969  hstart等于Our start address within vm_mm. HPAGE_PMD_MASK的反按位与HPAGE_PMD_MASK
1970  hend等于The first byte after our end addresswithin vm_mm. 按位与HPAGE_PMD_MASK
1971  如果hstart大于等于hend则转到:skip
1973  如果address大于hend则转到:skip
1975  如果address小于hstartaddress等于hstart
1977  VM_BUG_ON(address & ~HPAGE_PMD_MASK)
1979 address小于hend循环
1981  cond_resched()
2001  否则
2007  address加等于HPAGE_PMD_SIZE
2008  progress加等于HPAGE_PMD_NR
2009  如果ret则转到:breakouterloop_mmap_sem
2012  如果progress大于等于pages则转到:breakouterloop
2016  breakouterloop :
2017  lease a read lock
2018  breakouterloop_mmap_sem :
2020  加自旋锁
2021  VM_BUG_ON(mm_slot != mm_slot)
2026  如果khugepaged_test_exit(mm)或非vma
2032  如果链表后项不等于mm_head
2036  address等于0
2037  否则
2038  mm_slot = NULL
2039  khugepaged_full_scans自加
2042  collect_mm_slot(mm_slot)
2045  返回:progress
调用者
名称描述
khugepaged_do_scan