函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_mbind

函数原型:static long do_mbind(unsigned long start, unsigned long len, unsigned short mode, unsigned short mode_flags, nodemask_t *nmask, unsigned long flags)

返回类型:long

参数:

类型参数名称
unsigned longstart
unsigned longlen
unsigned shortmode
unsigned shortmode_flags
nodemask_t *nmask
unsigned longflags
1236  mm等于mm
1241  LIST_HEAD(pagelist)
1243  如果flags按位与MPOL_MF_VALID的反则返回:负EINVAL
1245  如果flags按位与Move every page to conform to policy 且非操作权限检查则返回:负EPERM
1248  如果start按位与PAGE_MASK的反则返回:负EINVAL
1251  如果mode恒等于MPOL_DEFAULTflags与等于Verify existing pages in the mapping 的反
1254  len等于lenPAGE_SIZE减1按位与PAGE_MASK
1255  end等于startlen
1257  如果end小于start则返回:负EINVAL
1259  如果end恒等于start则返回:0
1262  new等于This function just creates a new policy, does some check and simple* initialization. You must invoke mpol_set_nodemask() to set nodes.
1263  如果是错误则返回:错误
1266  如果flags按位与Modifies '_MOVE: lazy migrate on fault See set_mempolicy() MPOL_F_* above 或等于his policy wants migrate on fault
1273  如果非newflags或等于Skip checks for continuous vmas
1276  pr_debug("mbind %lx-%lx mode:%d flags:%d nodes:%lx\n", start, start + len, mode, mode_flags, nmask ? nodes_addr( * nmask)[0] : NUMA_NO_NODE)
1280  如果flags按位与Move pages owned by this process to conformto policy 按位或Move every page to conform to policy 的值则
1282  err等于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()
1283  如果err则转到:mpol_out
1287  NODEMASK_SCRATCH(scratch)
1288  如果scratch
1293  如果errlease a write lock
1295  否则err等于负ENOMEM
1297  NODEMASK_SCRATCH_FREE(scratch)
1299  如果err则转到:mpol_out
1302  ret等于Walk through page tables and collect pages to be migrated
1305  如果ret小于0则
1306  err等于ret
1307  转到:up_out
1310  err等于Step 2: apply policy to a range and do splits.
1312  如果非err
1313  nr_failed等于0
1315  如果非链表为空
1323  如果ret大于0或nr_failedflags按位与Verify existing pages in the mapping err等于负EIO
1325  否则
1326  up_out :
1327  如果非链表为空Put previously isolated pages back onto the appropriate lists* from where they were once taken off for compaction/migration.* This function shall be used whenever the isolated pageset has been* built from lru, balloon, hugetlbfs page
1331  lease a write lock
1332  mpol_out :
1333  mpol_put(new)
1334  返回:err
调用者
名称描述
kernel_mbind