lkml.org 
[lkml]   [2006]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [take24 3/6] kevent: poll/select() notifications.
On Thu, 9 Nov 2006, Evgeniy Polyakov wrote:

> +static int kevent_poll_callback(struct kevent *k)
> +{
> + if (k->event.req_flags & KEVENT_REQ_LAST_CHECK) {
> + return 1;
> + } else {
> + struct file *file = k->st->origin;
> + unsigned int revents = file->f_op->poll(file, NULL);
> +
> + k->event.ret_data[0] = revents & k->event.event;
> +
> + return (revents & k->event.event);
> + }
> +}

You need to be careful that file->f_op->poll is not called inside the
spin_lock_irqsave/spin_lock_irqrestore pair, since (even this came up
during epoll developemtn days) file->f_op->poll might do a simple
spin_lock_irq/spin_unlock_irq. This unfortunate constrain forced epoll to
have a suboptimal double O(R) loop to handle LT events.



- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-09 19:55    [W:0.094 / U:3.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site