Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpol_misplaced - check whether current page node is valid in policy*@page: page to be checked*@vma: vm area where page mapped*@addr: virtual address where page mapped* Lookup current policy node id for vma,addr and "compare to" page's* node id

Proto:int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long addr)

Type:int

Parameter:

TypeParameterName
struct page *page
struct vm_area_struct *vma
unsigned longaddr
2408  curnid = page_to_nid(page)
2410  thiscpu = These macros fold the SMP functionality into a single CPU system()
2411  thisnid = cpu_to_node(thiscpu)
2412  polnid = NUMA_NO_NODE
2413  ret = -1
2415  pol = get_vma_policy(@vma, @addr)*@vma: virtual memory area whose policy is sought*@addr: address in @vma for shared policy lookup* Returns effective policy for a VMA at specified address
2416  If Not (See set_mempolicy() MPOL_F_* above & his policy wants migrate on fault ) Then Go to out
2420  Case See MPOL_* above == MPOL_INTERLEAVE
2421  pgoff = Offset (within vm_file) in PAGE_SIZEunits
2422  pgoff += addr - Our start address within vm_mm. >> PAGE_SHIFT determines the page size
2423  polnid = Do static interleaving for a VMA with known offset @n. Returns the n'th* node in pol->v.nodes (starting from n=0), wrapping around if n exceeds the* number of present nodes.
2424  Break
2426  Case See MPOL_* above == MPOL_PREFERRED
2427  If See set_mempolicy() MPOL_F_* above & preferred local allocation Then polnid = Returns the number of the current Node.
2429  Else polnid = preferred
2431  Break
2433  Case See MPOL_* above == MPOL_BIND
2441  If No static inline type checking - see Subtlety (1) above. (curnid, interleave/bind ) Then Go to out
2443  z = - Zoneref pointer for the first suitable zone found (see below)
2447  polnid = zone_to_nid(Pointer to actual zone )
2448  Break
2450  Default
2451  BUG()
2455  If See set_mempolicy() MPOL_F_* above & Migrate On protnone Reference On Node Then
2456  polnid = thisnid
2458  If Not should_numa_migrate_memory(current process, page, curnid, thiscpu) Then Go to out
2462  If curnid != polnid Then ret = polnid
2464  out :
2465  mpol_cond_put(pol)
2467  Return ret
Caller
NameDescribe
do_huge_pmd_numa_pageNUMA hinting page fault entry point for trans huge pmds