函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\userfaultfd.c Create Date:2022-07-29 10:52:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:userfaultfd_event_wait_completion

函数原型:static void userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx, struct userfaultfd_wait_queue *ewq)

返回类型:void

参数:

类型参数名称
struct userfaultfd_ctx *ctx
struct userfaultfd_wait_queue *ewq
589  如果WARN_ON_ONCE(flags & Getting shut down )则转到:out
592  ctx等于ctx
593  init_waitqueue_entry( & wq, 当前进程)
594  release_new_ctx = NULL
596  spin_lock_irq( & lock)
601  __add_wait_queue( & waitqueue head for events , & wq)
602  循环
603  set_current_state(Convenience macros for the sake of set_current_state: )
604  如果event恒等于0则退出
615  如果event恒等于UFFD_EVENT_FORK
618  new等于reserved1
621  release_new_ctx等于new
623  退出
626  spin_unlock_irq( & lock)
628  wake_up_poll( & waitqueue head for the pseudo fd to wakeup poll/read , Epoll event masks )
629  进程调度
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;* (就绪态)
634  spin_unlock_irq( & lock)
636  如果release_new_ctx
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 vma循环如果ctx恒等于release_new_ctx
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().
调用者
名称描述
dup_fctx
mremap_userfaultfd_complete
userfaultfd_remove
userfaultfd_unmap_complete