Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\hmm.c Create Date:2022-07-28 16:37:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:hmm_vma_walk_pmd

Proto:static int hmm_vma_walk_pmd(pmd_t *pmdp, unsigned long start, unsigned long end, struct mm_walk *walk)

Type:int

Parameter:

TypeParameterName
pmd_t *pmdp
unsigned longstart
unsigned longend
struct mm_walk *walk
373  hmm_vma_walk = private
374  range = range
375  pfns = pfns
376  addr = start
380  again :
381  pmd = READ_ONCE( * pmdp)
382  If pmd_none(pmd) Then Return hmm_vma_walk_hole(start, end, walk)
385  If thp_migration_supported() && is_pmd_migration_entry(pmd) Then
390  i = addr - start >> PAGE_SHIFT determines the page size
391  npages = end - addr >> PAGE_SHIFT determines the page size
392  pfns = pfns[i]
394  hmm_range_need_fault(hmm_vma_walk, pfns, npages, 0, & fault, & write_fault)
396  If fault || write_fault Then
397  last = addr
399  Return -EBUSY
401  Return 0
402  Else if Not pmd_present(pmd) Then Return hmm_pfns_fill(start, end, range, corresponding CPU page table entry points to poisoned memory)
405  If pmd_devmap(pmd) || pmd_trans_huge(pmd) Then
415  pmd = pmd_read_atomic(pmdp)
416  The "volatile" is due to gcc bugs ()
417  If Not pmd_devmap(pmd) && Not pmd_trans_huge(pmd) Then Go to again
420  i = addr - start >> PAGE_SHIFT determines the page size
421  Return hmm_vma_handle_pmd(walk, addr, end, & pfns[i], pmd)
430  If pmd_bad(pmd) Then Return hmm_pfns_fill(start, end, range, corresponding CPU page table entry points to poisoned memory)
433  ptep = pte_offset_map(pmdp, addr)
434  i = addr - start >> PAGE_SHIFT determines the page size
435  When addr < end cycle
438  r = hmm_vma_handle_pte(walk, addr, end, pmdp, ptep, & pfns[i])
439  If r Then
441  last = addr
442  Return r
445  If pgmap Then
452  put_dev_pagemap(pgmap)
453  pgmap = NULL
455  pte_unmap(ptep - 1)
457  last = addr
458  Return 0