函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-27 17:04:23
Last Modify:2020-03-17 22:28:11 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Retrieve NUMA policy

函数原型:static long do_get_mempolicy(int *policy, nodemask_t *nmask, unsigned long addr, unsigned long flags)

返回类型:long

参数:

类型参数名称
int *policy
nodemask_t *nmask
unsigned longaddr
unsigned longflags
890  mm等于mm
891  struct vm_area_struct * vma = NULL
892  struct mempolicy * pol = mempolicy, * pol_refcount = NULL
894  如果flags按位与urn next IL mode instead of node mask 按位或look up vma using address 按位或urn allowed memories 的值的反则返回:负EINVAL
898  如果flags按位与urn allowed memories
899  如果flags按位与urn next IL mode instead of node mask 按位或look up vma using address 的值则返回:负EINVAL
901  policy等于0
902  Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring* subscriptions and synchronises with wait4(). Also used in procfs. Also* pins the final release of task.io_context. Also protects ->cpuset and* ->cgroup.subsys[]. And ->vfork_done.
903  nmask等于cpuset_current_mems_allowed
904  task_unlock(当前进程)
905  返回:0
908  如果flags按位与look up vma using address
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  如果非vma
918  返回:负EFAULT
920  如果Function pointers to deal with this struct. get_policypol等于get_policy(vma, addr)
922  否则pol等于NUMA policy for the VMA
924  否则如果addr则返回:负EINVAL
927  如果非polpol等于un-time system-wide default policy => local allocation
930  如果flags按位与urn next IL mode instead of node mask
931  如果flags按位与look up vma using address
938  pol_refcount等于pol
939  vma = NULL
940  mpol_get(pol)
941  err等于lookup_node(mm, addr)
942  如果err小于0则转到:out
944  policy等于err
945  否则如果pol恒等于mempolicySee MPOL_* above 恒等于MPOL_INTERLEAVE
948  否则
949  err等于负EINVAL
950  转到:out
952  否则
953  policy等于如果pol恒等于un-time system-wide default policy => local allocationMPOL_DEFAULT否则See MPOL_* above
959  policy或等于See set_mempolicy() MPOL_F_* above 按位与MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to* either set_mempolicy() or mbind().
962  err等于0
963  如果nmask
964  如果mpol_store_user_nodemask(pol)则
966  否则
973  out :
974  mpol_cond_put(pol)
975  如果vmalease a read lock
977  如果pol_refcountmpol_put(pol_refcount)
979  返回:err
调用者
名称描述
kernel_get_mempolicyRetrieve NUMA policy