Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\migrate.c Create Date:2022-07-28 15:59:45
Last Modify:2022-05-20 09:53:13 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Move a list of pages in the address space of the currently executing* process.

Proto:static int kernel_move_pages(pid_t pid, unsigned long nr_pages, const void __user *__user *pages, const int __user *nodes, int __user *status, int flags)

Type:int

Parameter:

TypeParameterName
pid_tpid
unsigned longnr_pages
const void __user *__user *pages
const int __user *nodes
int __user *status
intflags
1793  If flags & ~(Move pages owned by this process to conformto policy | Move every page to conform to policy ) Then Return -EINVAL
1796  If flags & Move every page to conform to policy && Not Check operation authority Then Return -EPERM
1800  _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
1801  task = If pid Then find_task_by_vpid(pid) Else current process
1802  If Not task Then
1803  _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()
1804  Return -ESRCH
1806  get_task_struct(task)
1812  If Not ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS) Then
1813  _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()
1814  err = -EPERM
1815  Go to out
1817  _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()
1819  err = security_task_movememory(task)
1820  If err Then Go to out
1823  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
1824  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
1825  put_task_struct(task)
1827  If Not mm Then Return -EINVAL
1830  If nodes Then err = Migrate an array of page address onto an array of nodes and fill* the corresponding array of status.
1833  Else err = Determine the nodes of a user array of pages and store it in* a user array of status.
1836  Decrement the use count and release all resources for an mm.
1837  Return err
1839  out :
1840  put_task_struct(task)
1841  Return err