Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\khugepaged.c Create Date:2022-07-28 16:07:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:khugepaged_scan_mm_slot

Proto:static unsigned int khugepaged_scan_mm_slot(unsigned int pages, struct page **hpage)__releases(&khugepaged_mm_lock) __acquires(&khugepaged_mm_lock)

Type:unsigned int

Parameter:

TypeParameterName
unsigned intpages
struct page **hpage
1928  progress = 0
1930  VM_BUG_ON(!pages)
1931  lockdep_assert_held( & khugepaged_mm_lock)
1933  If mm_slot Then mm_slot = mm_slot
1935  Else
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.(next, structmm_slot, mm_node)
1938  address = 0
1939  mm_slot = mm_slot
1941  spin_unlock( & khugepaged_mm_lock)
1942  khugepaged_collapse_pte_mapped_thps(mm_slot)
1944  mm = mm
1949  vma = NULL
1950  If Value for the false possibility is greater at compile time(!rylock for reading -- returns 1 if successful, 0 if contention) Then Go to breakouterloop_mmap_sem
1952  If Value is more likely to compile time(!khugepaged_test_exit(mm)) Then vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
1955  progress++
1956  When vma cycle
1959  cond_resched()
1961  progress++
1962  Break
1965  :
1966  progress++
1967  Continue
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  If hstart >= hend Then Go to skip
1973  If address > hend Then Go to skip
1975  If address < hstart Then address = hstart
1977  VM_BUG_ON(address & ~HPAGE_PMD_MASK)
1979  When address < hend cycle
1981  cond_resched()
2001  Else
2009  If ret Then Go to breakouterloop_mmap_sem
2012  If progress >= pages Then Go to breakouterloop
2016  breakouterloop :
2017  lease a read lock
2018  breakouterloop_mmap_sem :
2020  spin_lock( & khugepaged_mm_lock)
2021  VM_BUG_ON(mm_slot != mm_slot)
2026  If khugepaged_test_exit(mm) || Not vma Then
2032  If next != mm_head Then
2036  address = 0
2037  Else
2038  mm_slot = NULL
2042  collect_mm_slot(mm_slot)
2045  Return progress
Caller
NameDescribe
khugepaged_do_scan