| Function report | 
| Source Code: mm\mempolicy.c | Create Date:2022-07-28 15:31:36 | 
| Last Modify:2020-03-17 22:28:11 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Retrieve NUMA policy
Proto:static long do_get_mempolicy(int *policy, nodemask_t *nmask, unsigned long addr, unsigned long flags)
Type:long
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int * | policy | |
| nodemask_t * | nmask | |
| unsigned long | addr | |
| unsigned long | flags | 
| 891 | struct vm_area_struct * vma = NULL | 
| 892 | struct mempolicy * pol = mempolicy, * pol_refcount = NULL | 
| 894 | If flags & ~( urn next IL mode instead of node mask | look up vma using address | urn allowed memories ) Then Return -EINVAL | 
| 898 | If flags & urn allowed memories Then | 
| 899 | If flags & (urn next IL mode instead of node mask | look up vma using address ) Then Return -EINVAL | 
| 901 | policy = 0 | 
| 905 | Return 0 | 
| 908 | If flags & look up vma using address Then | 
| 914 | lock for reading | 
| 915 | vma = Look up the first VMA which intersects the interval start_addr..end_addr-1,NULL if none. Assume start_addr < end_addr. | 
| 916 | If Not vma Then | 
| 918 | Return -EFAULT | 
| 920 | If Function pointers to deal with this struct. && get_policy Then pol = get_policy(vma, addr) | 
| 922 | Else pol = NUMA policy for the VMA | 
| 927 | If Not pol Then pol = un-time system-wide default policy => local allocation | 
| 930 | If flags & urn next IL mode instead of node mask Then | 
| 931 | If flags & look up vma using address Then | 
| 945 | Else if pol == mempolicy && See MPOL_* above == MPOL_INTERLEAVE Then | 
| 948 | Else | 
| 952 | Else | 
| 953 | policy = If pol == un-time system-wide default policy => local allocation Then MPOL_DEFAULT Else See MPOL_* above | 
| 962 | err = 0 | 
| 963 | If nmask Then | 
| 973 | out : | 
| 974 | mpol_cond_put(pol) | 
| 975 | If vma Then lease a read lock | 
| 977 | If pol_refcount Then mpol_put(pol_refcount) | 
| 979 | Return err | 
| Name | Describe | 
|---|---|
| kernel_get_mempolicy | Retrieve NUMA policy | 
| 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 |