函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:p_scan_ready_list - Scans the ready list in a way that makes possible for* the scan code, to call f_op->poll(). Also allows for* O(NumReady) performance.*@ep: Pointer to the epoll private data structure.*@sproc: Pointer to the scan callback.

函数原型:static __poll_t ep_scan_ready_list(struct eventpoll *ep, __poll_t (*sproc)(struct eventpoll *, struct list_head *, void *), void *priv, int depth, bool ep_locked)

返回类型:__poll_t

参数:

类型参数名称
struct eventpoll *ep
__poll_t (*sproc
void *priv
intdepth
boolep_locked
670  LIST_HEAD(txlist)
672  lockdep_assert_irqs_enabled()
679  如果非ep_lockedmutex_lock_nested( & * This mutex is used to ensure that files are not removed * while epoll is using them. This is held during the event * collection loop, the file cleanup path, the epoll file exit * code and the ctl operations., depth)
690  write_lock_irq( & Lock which protects rdllist and ovflist )
691  加入二个链表项并重新初始化
692  WRITE_ONCE(* This is a single linked list that chains all the "struct epitem" that * happened while transferring ready events to userspace w/out * holding ->lock., NULL)
693  write_unlock_irq( & Lock which protects rdllist and ovflist )
698  res = ( * sproc)(ep, & txlist, priv)
700  write_lock_irq( & Lock which protects rdllist and ovflist )
706  以(epi = nepi) != NULL循环
728  WRITE_ONCE(* This is a single linked list that chains all the "struct epitem" that * happened while transferring ready events to userspace w/out * holding ->lock., EP_UNACTIVE_PTR)
733  为栈加入第二个链表项
734  __pm_relax( wakeup_source used when ep_scan_ready_list is running )
735  write_unlock_irq( & Lock which protects rdllist and ovflist )
737  如果非ep_lockedmutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
740  返回:res
调用者
名称描述
ep_item_pollDiffers from ep_eventpoll_poll() in that internal callers already have* the ep->mtx so we need to start from depth=1, such that mutex_lock_nested()* is correctly annotated.
ep_eventpoll_poll
ep_send_events