Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:userfaultfd_event_wait_completion

Proto:static void userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx, struct userfaultfd_wait_queue *ewq)

Type:void

Parameter:

TypeParameterName
struct userfaultfd_ctx *ctx
struct userfaultfd_wait_queue *ewq
589  If WARN_ON_ONCE(flags & Getting shut down ) Then Go to out
592  ctx = ctx
593  init_waitqueue_entry( & wq, current process)
594  release_new_ctx = NULL
596  spin_lock_irq( & lock)
601  __add_wait_queue( & waitqueue head for events , & wq)
602  cycle
603  set_current_state(Convenience macros for the sake of set_current_state: )
604  If event == 0 Then Break
615  If event == UFFD_EVENT_FORK Then
618  new = reserved1
623  Break
626  spin_unlock_irq( & lock)
628  wake_up_poll( & waitqueue head for the pseudo fd to wakeup poll/read , Epoll event masks )
629  schedule()
631  spin_lock_irq( & lock)
633  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (Used in tsk->state: )
634  spin_unlock_irq( & lock)
636  If release_new_ctx Then
638  mm = mm with one ore more vmas attached to this userfaultfd_ctx
641  lock for writing
643  VM_WARN_ON(!This has to be called after a get_task_mm()/mmget_not_zero()* followed by taking the mmap_sem for writing before modifying the* vmas or anything the coredump pretends not to change from under it)
644  When vma cycle If ctx == release_new_ctx Then
646  vm_userfaultfd_ctx = NULL_VM_UFFD_CTX
647  Flags, see mm.h. &= ~(wrprotect pages tracking | missing pages tracking )
649  lease a write lock
651  serfaultfd_ctx_put - Releases a reference to the internal userfaultfd* context.*@ctx: [in] Pointer to userfaultfd context.* The userfaultfd context reference must have been previously acquired either* with userfaultfd_ctx_get() or userfaultfd_ctx_fdget().
658  out :
659  WRITE_ONCE(memory mappings are changing because of non-cooperative event , false)
660  serfaultfd_ctx_put - Releases a reference to the internal userfaultfd* context.*@ctx: [in] Pointer to userfaultfd context.* The userfaultfd context reference must have been previously acquired either* with userfaultfd_ctx_get() or userfaultfd_ctx_fdget().
Caller
NameDescribe
dup_fctx
mremap_userfaultfd_complete
userfaultfd_remove
userfaultfd_unmap_complete