函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This is the callback that is passed to the wait queue wakeup* mechanism

函数原型:static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)

返回类型:int

参数:

类型参数名称
wait_queue_entry_t *wait
unsignedmode
intsync
void *key
1188  pwake等于0
1189  epi等于Get the "struct epitem" from a wait queue pointer
1190  ep等于The "container" of this item
1191  pollflags等于key_to_poll(key)
1193  ewake等于0
1195  read_lock_irqsave( & Lock which protects rdllist and ovflist , flags)
1197  ep_set_busy_poll_napi_id(epi)
1205  如果非events按位与Epoll private bits inside the event mask 的反的值则转到:out_unlock
1214  如果pollflags且非pollflags按位与events的值则转到:out_unlock
1223  如果READ_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
1224  如果Works together "struct eventpoll"->ovflist in keeping the* single linked chain of items.恒等于EP_UNACTIVE_PTRChains a new epi entry to the tail of the ep->ovflist in a lockless way,* i.e. multiple CPUs are allowed to call this function concurrently.* Returns %false if epi element has been already chained, %true otherwise.all when ep->mtx cannot be held (ep_poll_callback)
1227  转到:out_unlock
1231  如果非Tells us if the item is currently linked Adds a new entry to the tail of the list in a lockless way, i
1233  all when ep->mtx cannot be held (ep_poll_callback)
1240  如果waitqueue_active -- locklessly test for waiters on the queue*@wq_head: the waitqueue to test for waiters* returns true if the wait list is not empty* NOTE: this function is lockless and requires care, incorrect usage _will_
1244  : & == Epoll event masks
1245  如果events按位与Epoll event masks ewake等于1
1247  退出
1248  : & == EPOLLOUT
1249  如果events按位与EPOLLOUTewake等于1
1251  退出
1252  : & == 0
1253  ewake等于1
1254  退出
1257  wake_up( & Wait queue used by sys_epoll_wait() )
1259  如果waitqueue_active -- locklessly test for waiters on the queue*@wq_head: the waitqueue to test for waiters* returns true if the wait list is not empty* NOTE: this function is lockless and requires care, incorrect usage _will_pwake自加
1262  out_unlock :
1263  read_unlock_irqrestore( & Lock which protects rdllist and ovflist , flags)
1266  如果pwakeep_poll_safewake( & Wait queue used by file->poll() )
1269  如果非events按位与Set exclusive wakeup mode for the target file descriptor 的值则ewake等于1
1272  如果pollflags按位与POLLFREE
1278  删除链表项并重新初始化
1285  smp_store_release( & The wait queue head that linked the "wait" wait queue item , NULL)
1288  返回:ewake