Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Similar to page_get_anon_vma() except it locks the anon_vma.* Its a little more complex as it tries to keep the fast path to a single* atomic op -- the trylock. If we fail the trylock, we fall back to getting a

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

Type:struct anon_vma

Parameter:

TypeParameterName
struct page *page
530  struct anon_vma * anon_vma = NULL
534  _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
535  anon_mapping = READ_ONCE( See page-flags.h for PAGE_MAPPING_FLAGS )
536  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
538  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
541  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
542  root_anon_vma = READ_ONCE(Root of this anon_vma tree )
543  If rylock for reading -- returns 1 if successful, 0 if contention Then
551  anon_vma = NULL
553  Go to out
557  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
558  anon_vma = NULL
559  Go to out
562  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
563  _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()
564  put_anon_vma(anon_vma)
565  Return NULL
569  _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()
570  anon_vma_lock_read(anon_vma)
572  If atomic_dec_and_test( & The refcount is taken on an anon_vma when there is no* guarantee that the vma of page tables will exist for* the duration of the operation. A caller that takes* the reference is responsible for clearing up the* anon_vma if they are the last user on release) Then
578  anon_vma_unlock_read(anon_vma)
579  __put_anon_vma(anon_vma)
580  anon_vma = NULL
583  Return anon_vma
585  out :
586  _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()
587  Return anon_vma
Caller
NameDescribe
do_huge_pmd_numa_pageNUMA hinting page fault entry point for trans huge pmds
collect_procs_anonCollect processes when the error hit an anonymous page.