Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Getting a lock on a stable anon_vma from a page off the LRU is tricky!* Since there is no serialization what so ever against page_remove_rmap()* the best this function can do is return a locked anon_vma that might* have been relevant to this page

Proto:struct anon_vma *page_get_anon_vma(struct page *page)

Type:struct anon_vma

Parameter:

TypeParameterName
struct page *page
487  struct anon_vma * anon_vma = NULL
490  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
491  anon_mapping = READ_ONCE( See page-flags.h for PAGE_MAPPING_FLAGS )
492  If (anon_mapping & PAGE_MAPPING_FLAGS) != On an anonymous page mapped into a user virtual memory area,* page->mapping points to its anon_vma, not to a struct address_space;* with the PAGE_MAPPING_ANON bit set to distinguish it Then Go to out
494  If Not Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped. Then Go to out
497  anon_vma * anon_vma = anon_mapping - On an anonymous page mapped into a user virtual memory area,* page->mapping points to its anon_vma, not to a struct address_space;* with the PAGE_MAPPING_ANON bit set to distinguish it
498  If Not atomic_inc_not_zero - increment unless the number is zero*@v: pointer of type atomic_t* Atomically increments @v by 1, if @v is non-zero.* Returns true if the increment was done. Then
499  anon_vma = NULL
500  Go to out
510  If Not Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped. Then
511  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
512  put_anon_vma(anon_vma)
513  Return NULL
515  out :
516  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
518  Return anon_vma
Caller
NameDescribe
__unmap_and_move
unmap_and_move_huge_pageCounterpart of unmap_and_move_page() for hugepage migration
split_huge_page_to_listThis function splits huge page into normal pages. @page can point to any* subpage of huge page to split. Split doesn't change the position of @page.* Only caller must hold pin on the @page, otherwise split fails with -EBUSY.* The huge page must be locked.