Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-28 15:31:58
Last Modify:2020-03-17 22:28:11 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_mbind

Proto:static long do_mbind(unsigned long start, unsigned long len, unsigned short mode, unsigned short mode_flags, nodemask_t *nmask, unsigned long flags)

Type:long

Parameter:

TypeParameterName
unsigned longstart
unsigned longlen
unsigned shortmode
unsigned shortmode_flags
nodemask_t *nmask
unsigned longflags
1236  mm = mm
1241  LIST_HEAD(pagelist)
1243  If flags & ~MPOL_MF_VALID Then Return -EINVAL
1245  If flags & Move every page to conform to policy && Not Check operation authority Then Return -EPERM
1248  If start & ~PAGE_MASK Then Return -EINVAL
1251  If mode == MPOL_DEFAULT Then flags &= ~Verify existing pages in the mapping
1254  len = len + PAGE_SIZE - 1 & PAGE_MASK
1255  end = start + len
1257  If end < start Then Return -EINVAL
1259  If end == start Then Return 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  If IS_ERR(new) Then Return PTR_ERR(new)
1266  If flags & Modifies '_MOVE: lazy migrate on fault Then See set_mempolicy() MPOL_F_* above |= his policy wants migrate on fault
1273  If Not new Then flags |= 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  If flags & (Move pages owned by this process to conformto policy | Move every page to conform to policy ) Then
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  If err Then Go to mpol_out
1287  NODEMASK_SCRATCH(scratch)
1288  If scratch Then
1293  If err Then lease a write lock
1295  Else err = -ENOMEM
1297  NODEMASK_SCRATCH_FREE(scratch)
1299  If err Then Go to mpol_out
1302  ret = Walk through page tables and collect pages to be migrated
1305  If ret < 0 Then
1306  err = ret
1307  Go to up_out
1310  err = Step 2: apply policy to a range and do splits.
1312  If Not err Then
1313  nr_failed = 0
1323  If ret > 0 || nr_failed && flags & Verify existing pages in the mapping Then err = -EIO
1325  Else
1326  up_out :
1327  If Not list_empty - tests whether a list is empty*@head: the list to test. Then 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  Return err
Caller
NameDescribe
kernel_mbind