Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Return true if we do MADV_FREE successfully on entire pmd page.* Otherwise, return false.

Proto:bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long next)

Type:bool

Parameter:

TypeParameterName
struct mmu_gather *tlb
struct vm_area_struct *vma
pmd_t *pmd
unsigned longaddr
unsigned longnext
1701  mm = mm
1702  bool ret = false
1704  tlb_change_page_size(tlb, HPAGE_PMD_SIZE)
1706  ptl = mmap_sem must be held on entry
1707  If Not ptl Then Go to out_unlocked
1710  orig_pmd = pmd
1711  If is_huge_zero_pmd(orig_pmd) Then Go to out
1714  If Value for the false possibility is greater at compile time(!pmd_present(orig_pmd)) Then
1715  VM_BUG_ON(thp_migration_supported() && !is_pmd_migration_entry(orig_pmd))
1717  Go to out
1720  page = Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(orig_pmd)
1725  If page_mapcount(page) != 1 Then Go to out
1728  If Not Return true if the page was successfully locked Then Go to out
1735  If next - addr != HPAGE_PMD_SIZE Then
1736  get_page(page)
1737  spin_unlock(ptl)
1738  split_huge_page(page)
1739  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1740  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1741  Go to out_unlocked
1744  If PageDirty(page) Then ClearPageDirty(page)
1746  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1748  If pmd_young(orig_pmd) || pmd_dirty(orig_pmd) Then
1749  pmdp_invalidate(vma, addr, pmd)
1750  orig_pmd = pmd_mkold(orig_pmd)
1751  orig_pmd = pmd_mkclean(orig_pmd)
1753  set_pmd_at(mm, addr, pmd, orig_pmd)
1754  tlb_remove_pmd_tlb_entry(tlb, pmd, addr)
1757  mark_page_lazyfree - make an anon page lazyfree*@page: page to deactivate* mark_page_lazyfree() moves @page to the inactive file list.* This is done to accelerate the reclaim of @page.
1758  ret = true
1759  out :
1760  spin_unlock(ptl)
1761  out_unlocked :
1762  Return ret
Caller
NameDescribe
madvise_free_pte_range