Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Verify the pagetables are still not ok after having reigstered into* the fault_pending_wqh to avoid userland having to UFFDIO_WAKE any* userfault that has already been resolved, if userfaultfd_read and* UFFDIO_COPY|ZEROPAGE are being run simultaneously on

Proto:static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx, unsigned long address, unsigned long flags, unsigned long reason)

Type:bool

Parameter:

TypeParameterName
struct userfaultfd_ctx *ctx
unsigned longaddress
unsigned longflags
unsigned longreason
281  mm = mm with one ore more vmas attached to this userfaultfd_ctx
287  bool ret = true
289  VM_BUG_ON(!In all implementations count != 0 means locked )
291  pgd = a shortcut to get a pgd_t in a given mm(mm, address)
292  If Not pgd_present( * pgd) Then Go to out
294  p4d = p4d_offset(pgd, address)
295  If Not p4d_present( * p4d) Then Go to out
297  pud = pud_offset(p4d, address)
298  If Not pud_present( * pud) Then Go to out
300  pmd = pmd_offset(pud, address)
309  _pmd = READ_ONCE( * pmd)
310  If pmd_none(_pmd) Then Go to out
313  ret = false
314  If Not pmd_present(_pmd) Then Go to out
317  If pmd_trans_huge(_pmd) Then Go to out
324  pte = pte_offset_map(pmd, address)
329  If pte_none( * pte) Then ret = true
331  pte_unmap(pte)
333  out :
334  Return ret
Caller
NameDescribe
handle_userfaultThe locking rules involved in returning VM_FAULT_RETRY depending on* FAULT_FLAG_ALLOW_RETRY, FAULT_FLAG_RETRY_NOWAIT and* FAULT_FLAG_KILLABLE are not straightforward