Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_move_charge_pte_range

Proto:static int mem_cgroup_move_charge_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk)

Type:int

Parameter:

TypeParameterName
pmd_t *pmd
unsigned longaddr
unsigned longend
struct mm_walk *walk
5682  ret = 0
5683  vma = vma
5690  ptl = mmap_sem must be held on entry
5691  If ptl Then
5692  If precharge < HPAGE_PMD_NR Then
5693  spin_unlock(ptl)
5694  Return 0
5696  target_type = We don't consider PMD mapped swapping or file mapped pages because THP does* not support them for now.* Caller should make sure that pmd_trans_huge(pmd) is true.
5697  If target_type == MC_TARGET_PAGE Then
5698  page = page
5708  Else if target_type == MC_TARGET_DEVICE Then
5709  page = page
5717  spin_unlock(ptl)
5718  Return 0
5721  If This is a noop if Transparent Hugepage Support is not built into* the kernel Then Return 0
5723  retry :
5724  pte = pte_offset_map_lock(The address space we belong to. , pmd, addr, & ptl)
5725  When addr != end cycle
5726  ptent = * pte++
5727  bool device = false
5730  If Not precharge Then Break
5735  device = true
5738  page = page
5751  precharge--
5753  moved_charge++
5757  put :
5759  Break
5761  ent = ent
5763  precharge--
5765  moved_swap++
5767  Break
5768  Default
5769  Break
5772  pte_unmap_unlock(pte - 1, ptl)
5773  cond_resched()
5775  If addr != end Then
5782  ret = Handlers for move charge at task migration.
5783  If Not ret Then Go to retry
5787  Return ret