| Function report | 
| 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 activity | Download SCCT | Chinese | 
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:
| Type | Parameter | Name | 
|---|---|---|
| unsigned int | pages | |
| struct page ** | hpage | 
| 1928 | progress = 0 | 
| 1931 | lockdep_assert_held( & khugepaged_mm_lock) | 
| 1935 | Else | 
| 1938 | address = 0 | 
| 1941 | spin_unlock( & khugepaged_mm_lock) | 
| 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++ | 
| 1959 | cond_resched() | 
| 1961 | progress++ | 
| 1962 | Break | 
| 1964 | If Not hugepage_vma_check(vma, Flags, see mm.h. ) Then | 
| 1977 | VM_BUG_ON(address & ~HPAGE_PMD_MASK) | 
| 1981 | cond_resched() | 
| 1982 | If Value for the false possibility is greater at compile time(khugepaged_test_exit(mm)) Then Go to breakouterloop | 
| 1990 | pgoff = linear_page_index(vma, address) | 
| 1993 | If shmem_file(File we map to (can be NULL). ) && Not shmem_huge_enabled(vma) Then Go to skip | 
| 1996 | file = get_file(File we map to (can be NULL). ) | 
| 1997 | lease a read lock | 
| 1998 | ret = 1 | 
| 1999 | khugepaged_scan_file(mm, file, pgoff, hpage) | 
| 2001 | Else | 
| 2007 | address += HPAGE_PMD_SIZE | 
| 2008 | progress += HPAGE_PMD_NR | 
| 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) | 
| 2026 | If khugepaged_test_exit(mm) || Not vma Then | 
| 2036 | address = 0 | 
| 2037 | Else | 
| 2038 | mm_slot = NULL | 
| 2039 | khugepaged_full_scans++ | 
| 2042 | collect_mm_slot(mm_slot) | 
| 2045 | Return progress | 
| Name | Describe | 
|---|---|
| khugepaged_do_scan | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |