Function report |
Source Code:mm\gup.c |
Create Date:2022-07-28 14:35:01 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__get_user_pages() - pin user pages in memory*@tsk: task_struct of target task*@mm: mm_struct of target mm*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour
Proto:static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas, int *nonblocking)
Type:long
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct task_struct * | tsk | |
| struct mm_struct * | mm | |
| unsigned long | start | |
| unsigned long | nr_pages | |
| unsigned int | gup_flags | |
| struct page ** | pages | |
| struct vm_area_struct ** | vmas | |
| int * | nonblocking |
| 791 | struct vm_area_struct * vma = NULL |
| 792 | struct follow_page_context ctx = {NULL} |
| 794 | If Not nr_pages Then Return 0 |
| 799 | VM_BUG_ON(!!pages != !!(gup_flags & do get_page on page )) |
| 806 | If Not (gup_flags & get_user_pages read/write w/o permission ) Then gup_flags |= rce NUMA hinting page fault |
| 809 | Do |
| 811 | foll_flags = gup_flags |
| 815 | If Not vma || start >= The first byte after our end addresswithin vm_mm. Then |
| 816 | vma = find_extend_vma(mm, start) |
| 817 | If Not vma && in_gate_area(mm, start) Then |
| 827 | If Not vma || check_vma_flags(vma, gup_flags) Then |
| 831 | If is_vm_hugetlb_page(vma) Then |
| 838 | retry : |
| 843 | If fatal_signal_pending(current process) Then |
| 845 | Go to out |
| 847 | cond_resched() |
| 850 | If Not page Then |
| 854 | Case ret == 0 |
| 855 | Go to retry |
| 857 | ret = 0 |
| 862 | Go to out |
| 864 | Go to next_page |
| 866 | BUG() |
| 872 | Go to next_page |
| 877 | If pages Then |
| 883 | next_page : |
| 884 | If vmas Then |
| 888 | page_increm = 1 + ( ~(start >> PAGE_SHIFT determines the page size ) & page_mask) |
| 889 | If page_increm > nr_pages Then page_increm = nr_pages |
| 891 | i += page_increm |
| 892 | start += page_increm * PAGE_SIZE |
| 893 | nr_pages -= page_increm |
| 895 | out : |
| 896 | If pgmap Then put_dev_pagemap(pgmap) |
| Name | Describe |
|---|---|
| __get_user_pages_locked | |
| populate_vma_page_range | populate_vma_page_range() - populate a range of pages in the vma |
| 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 |