函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\migrate.c Create Date:2022-07-27 17:33:41
Last Modify:2022-05-20 09:53:13 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Migrate an array of page address onto an array of nodes and fill* the corresponding array of status.

函数原型:static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, unsigned long nr_pages, const void __user *__user *pages, const int __user *nodes, int __user *status, int flags)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
nodemask_ttask_nodes
unsigned longnr_pages
const void __user *__user *pages
const int __user *nodes
int __user *status
intflags
1596  current_node等于NUMA_NO_NODE
1597  LIST_HEAD(pagelist)
1599  err等于0
1601  migrate_prep() needs to be called before we start compiling a list of pages* to be migrated using isolate_lru_page(). If scheduling work on other CPUs is* undesirable, use migrate_prep_local()
1603 i小于nr_pages循环
1604  __userp
1608  err等于负EFAULT
1609  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(p, pages + i)则转到:out_flush
1611  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(node, nodes + i)则转到:out_flush
1613  addr等于Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(p)
1615  err等于负ENODEV
1616  如果node小于0或node大于等于MAX_NUMNODES则转到:out_flush
1618  如果非node_state(node, N_MEMORY)则转到:out_flush
1621  err等于负EACCES
1622  如果非No static inline type checking - see Subtlety (1) above. (node, task_nodes)则转到:out_flush
1625  如果current_node恒等于NUMA_NO_NODE
1626  current_node等于node
1627  start等于i
1628  否则如果node不等于current_node
1630  如果err
1639  如果err大于0则err加等于nr_pagesi减1
1641  转到:out
1644  如果err则转到:out
1646  start等于i
1647  current_node等于node
1654  err等于Resolves the given address to a struct page, isolates it from the LRU and* puts it to the given pagelist
1657  如果非err
1659  err等于store_status(status, i, current_node, 1)
1660  如果err则转到:out_flush
1662  继续下一循环
1663  否则如果err大于0则
1665  继续下一循环
1668  err等于store_status(status, i, err, 1)
1669  如果err则转到:out_flush
1672  err等于do_move_pages_to_node(mm, & pagelist, current_node)
1673  如果err
1674  如果err大于0则err加等于nr_pagesi减1
1676  转到:out
1678  如果i大于start
1680  如果err则转到:out
1683  current_node等于NUMA_NO_NODE
1685  out_flush :
1686  如果链表为空则返回:err
1690  err1等于do_move_pages_to_node(mm, & pagelist, current_node)
1698  如果非err1err1等于store_status(status, start, current_node, i - start)
1700  如果err大于等于0则err等于err1
1702  out :
1703  返回:err
调用者
名称描述
kernel_move_pagesMove a list of pages in the address space of the currently executing* process.