when and where does ep_poll_callback be called ?
Subsystems (3)
hi:
I'm studying the epoll module , I can not find ep_poll_callback be called somewhere .
thanks!
Quoted 4 lines · horseriver
hi:
I'm studying the epoll module , I can not find
ep_poll_callbackbe called somewhere .
It's right there in fs/eventpoll.c:
/*
* This is the callback that is used to add our wait queue to the
* target file wakeup lists.
*/
static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
poll_table *pt)
{
struct epitem *epi = ep_item_from_epqueue(pt);
struct eppoll_entry *pwq;
if (epi->nwait >= 0 && (pwq = kmem_cache_alloc(pwq_cache, GFP_KERNEL))) {Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
init_waitqueue_func_entry(&pwq->wait, ep_poll_callback);
pwq->whead = whead; pwq->base = epi; add_wait_queue(whead, &pwq->wait); list_add_tail(&pwq->llink, &epi->pwqlist); epi->nwait++;
Signature · 1 line
~Randy
Quoted 16 lines · Randy Dunlap
Quoted 4 lines · horseriver
hi:
I'm studying the epoll module , I can not find
ep_poll_callbackbe called somewhere .It's right there in
fs/eventpoll.c:/*
* This is the callback that is used to add our wait queue to the
* target file wakeup lists.
*/
static void ep_ptable_queue_proc(struct file *file,wait_queue_head_t*whead,
poll_table*pt)
Quoted 6 lines
{ struct epitem *epi = ep_item_from_epqueue(pt); struct eppoll_entry *pwq; if (epi->nwait >= 0 && (pwq = kmem_cache_alloc(pwq_cache, GFP_KERNEL))) {Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
init_waitqueue_func_entry(&pwq->wait, ep_poll_callback);
Thanks!
I know this is setting the callbak function into watqueue . But not the called place .
I want to know the code which calls ep_poll_callback .
Perhaps , it is called at tcp layer when a datagram is reached . but I have not find that key code .
Quoted 10 lines
pwq->whead = whead; pwq->base = epi; add_wait_queue(whead, &pwq->wait); list_add_tail(&pwq->llink, &epi->pwqlist); epi->nwait++;Signature · 1 line
~Randy
Quoted 6 lines · horseriver
hi:
I'm studying the epoll module , I can not find
ep_poll_callbackbe called somewhere .
Thats more a lkml question.
But you can figure it yourself :
fs/eventpoll.c +1 -0
@@ -928,6 +928,7 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *kstruct epitem *epi =ep_item_from_wait (wait);struct eventpoll *ep = epi->ep; +WARN_ON_ONCE (1 );if ((unsigned long )key &POLLFREE ) {ep_pwq_from_wait (wait)->whead =NULL ;/*