函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kernel_migrate_pages

函数原型:static int kernel_migrate_pages(pid_t pid, unsigned long maxnode, const unsigned long __user *old_nodes, const unsigned long __user *new_nodes)

返回类型:int

参数:

类型参数名称
pid_tpid
unsigned longmaxnode
const unsigned long __user *old_nodes
const unsigned long __user *new_nodes
1478  struct mm_struct * mm = NULL
1484  NODEMASK_SCRATCH(scratch)
1486  如果非scratch则返回:负ENOMEM
1489  old等于mask1
1490  new等于mask2
1492  err等于Copy a node mask from user space.
1493  如果err则转到:out
1496  err等于Copy a node mask from user space.
1497  如果err则转到:out
1501  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1502  task等于如果pidfind_task_by_vpid(pid)否则当前进程
1503  如果非task
1504  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1505  err等于负ESRCH
1506  转到:out
1508  get_task_struct(task)
1510  err等于负EINVAL
1516  如果非ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)则
1517  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1518  err等于负EPERM
1519  转到:out_put
1521  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1523  task_nodes等于cpuset_mems_allowed(task)
1525  如果非nodes_subset( * new, task_nodes)且非操作权限检查
1526  err等于负EPERM
1527  转到:out_put
1530  task_nodes等于puset_mems_allowed - return mems_allowed mask from a tasks cpuset.*@tsk: pointer to task_struct from which to obtain cpuset->mems_allowed.* Description: Returns the nodemask_t mems_allowed of the cpuset* attached to the specified @tsk
1531  nodes_and( * new, * new, task_nodes)
1532  如果nodes_empty( * new)则转到:out_put
1535  err等于security_task_movememory(task)
1536  如果err则转到:out_put
1539  mm等于get_task_mm - acquire a reference to the task's mm* Returns %NULL if the task has no mm. Checks PF_KTHREAD (meaning* this kernel workthread has transiently adopted a user mm with use_mm,* to do its AIO) is not set and if so returns a reference to it, after
1540  put_task_struct(task)
1542  如果非mm
1543  err等于负EINVAL
1544  转到:out
1547  err等于Move pages between the two nodesets so as to preserve the physical* layout as much as possible.* Returns the number of page that could not be moved.
1550  Decrement the use count and release all resources for an mm.
1551  out :
1552  NODEMASK_SCRATCH_FREE(scratch)
1554  返回:err
1556  out_put :
1557  put_task_struct(task)
1558  转到:out
调用者
名称描述
SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE4