Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto: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)

Type:__poll_t

Parameter:

TypeParameterName
struct eventpoll *ep
__poll_t (*sproc
void *priv
intdepth
boolep_locked
670  LIST_HEAD(txlist)
672  lockdep_assert_irqs_enabled()
679  If Not ep_locked Then mutex_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  list_splice_init - join two lists and reinitialise the emptied list.*@list: the new list to add.*@head: the place to add it in the first list.* The list at @list is reinitialised
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  When (epi = nepi) != NULL cycle
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  list_splice - join two lists, this is designed for stacks*@list: the new list to add.*@head: the place to add it in the first list.
734  __pm_relax( wakeup_source used when ep_scan_ready_list is running )
735  write_unlock_irq( & Lock which protects rdllist and ovflist )
737  If Not ep_locked Then mutex_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  Return res
Caller
NameDescribe
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