* when and where does ep_poll_callback be called ?
@ 2013-01-14 1:11 horseriver
2013-01-14 16:35 ` Randy Dunlap
2013-03-13 5:00 ` Eric Dumazet
0 siblings, 2 replies; 4+ messages in thread
From: horseriver @ 2013-01-14 1:11 UTC (permalink / raw)
To: netdev
hi:
I'm studying the epoll module , I can not find ep_poll_callback be called somewhere .
thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: when and where does ep_poll_callback be called ?
2013-01-14 16:35 ` Randy Dunlap
@ 2013-01-14 7:52 ` horseriver
0 siblings, 0 replies; 4+ messages in thread
From: horseriver @ 2013-01-14 7:52 UTC (permalink / raw)
To: Randy Dunlap; +Cc: netdev
On Mon, Jan 14, 2013 at 08:35:29AM -0800, Randy Dunlap wrote:
> On 01/13/13 17:11, horseriver wrote:
> > hi:
> >
> >
> > I'm studying the epoll module , I can not find ep_poll_callback be 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))) {
> >>>>> 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 .
> pwq->whead = whead;
> pwq->base = epi;
> add_wait_queue(whead, &pwq->wait);
> list_add_tail(&pwq->llink, &epi->pwqlist);
> epi->nwait++;
>
>
>
> --
> ~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: when and where does ep_poll_callback be called ?
2013-01-14 1:11 when and where does ep_poll_callback be called ? horseriver
@ 2013-01-14 16:35 ` Randy Dunlap
2013-01-14 7:52 ` horseriver
2013-03-13 5:00 ` Eric Dumazet
1 sibling, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2013-01-14 16:35 UTC (permalink / raw)
To: horseriver; +Cc: netdev
On 01/13/13 17:11, horseriver wrote:
> hi:
>
>
> I'm studying the epoll module , I can not find ep_poll_callback be 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))) {
>>>>> 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++;
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: when and where does ep_poll_callback be called ?
2013-01-14 1:11 when and where does ep_poll_callback be called ? horseriver
2013-01-14 16:35 ` Randy Dunlap
@ 2013-03-13 5:00 ` Eric Dumazet
1 sibling, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2013-03-13 5:00 UTC (permalink / raw)
To: horseriver; +Cc: netdev
On Mon, 2013-01-14 at 09:11 +0800, horseriver wrote:
> hi:
>
>
> I'm studying the epoll module , I can not find ep_poll_callback be called somewhere .
>
>
Thats more a lkml question.
But you can figure it yourself :
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 9fec183..c6e7490 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -928,6 +928,7 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
struct 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;
/*
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-13 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 1:11 when and where does ep_poll_callback be called ? horseriver
2013-01-14 16:35 ` Randy Dunlap
2013-01-14 7:52 ` horseriver
2013-03-13 5:00 ` Eric Dumazet
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.