epoll 源码实现流程
2020-06-30 17:59:51 2 举报
epoll 源码实现流程。通过走读 linux 内核源码(eventpoll.h / eventpoll.c),整理了一下 epoll 内部实现的对应结构关系逻辑。
作者其他创作
大纲/内容
ep_poll_callback
wait_queue_head
+ lock : spinlock_t+ head : struct list_head
epi
epoll_ctl
poll_table
+ _key : __poll_t+ _qproc : poll_queue_proc
check fd events
ep_ptable_queue_proc
__add_wait_queue
wait_queue_entry
entry : struct list_headfunc : wait_queue_func_t
wenfh2020.com
ep_item_poll
driver
socket_wq
+ wait : wait_queue_head_t
events
epitem
tcp_poll
device
1
3
rbn
application
eventpoll
+ wq : wait_queue_head_t+ pool_wait : wait_queue_head_t+ rdllist : list_head+ rbr : rb_root_cached+ ovflist : epitem*+ ws : wakeup_source*+ file : file*
sock_def_wakeup
wakeup
file->f_op->poll
eppoll_entry
base : struct epitem*llink : struct list_head whead : wait_queue_head_t *wait : wait_queue_entry_t
2
epoll_create
epoll_filefd
+ file : struct file+ fd : int
sock
+ sk_wq : struct socket_wq*
epoll_wait
socket
+ ops : const struct proto_ops *+ file :struct file*+ wq : struct socket_wq+ sk : struct sock*
task_struct
+ files : struct files_struct *
rbr
ep_insert
ep_pqueue
+ pt : poll_table+ epi : epitem*
0 条评论
下一页