Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbWKGWxl (ORCPT ); Tue, 7 Nov 2006 17:53:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753417AbWKGWxl (ORCPT ); Tue, 7 Nov 2006 17:53:41 -0500 Received: from x35.xmailserver.org ([69.30.125.51]:47059 "EHLO x35.xmailserver.org") by vger.kernel.org with ESMTP id S1752901AbWKGWxk (ORCPT ); Tue, 7 Nov 2006 17:53:40 -0500 X-AuthUser: davidel@xmailserver.org Date: Tue, 7 Nov 2006 14:53:33 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Evgeniy Polyakov cc: David Miller , Ulrich Drepper , Andrew Morton , netdev , Zach Brown , Christoph Hellwig , Chase Venters , Johann Borck , Linux Kernel Mailing List , Jeff Garzik Subject: Re: [take23 3/5] kevent: poll/select() notifications. In-Reply-To: <11629182482792@2ka.mipt.ru> Message-ID: References: <11629182482792@2ka.mipt.ru> X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 35 On Tue, 7 Nov 2006, Evgeniy Polyakov wrote: > +static int kevent_poll_wait_callback(wait_queue_t *wait, > + unsigned mode, int sync, void *key) > +{ > + struct kevent_poll_wait_container *cont = > + container_of(wait, struct kevent_poll_wait_container, wait); > + struct kevent *k = cont->k; > + struct file *file = k->st->origin; > + u32 revents; > + > + revents = file->f_op->poll(file, NULL); > + > + kevent_storage_ready(k->st, NULL, revents); > + > + return 0; > +} Are you sure you can safely call file->f_op->poll() from inside a callback based wakeup? The low level driver may be calling the wakeup with one of its locks held, and during the file->f_op->poll may be trying to acquire the same lock. I remember there was a discussion about this, and assuming the above not true, made epoll code more complex (and slower, since an extra O(R) loop was needed to fetch 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/