From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756709AbYHZTvj (ORCPT ); Tue, 26 Aug 2008 15:51:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753305AbYHZTvb (ORCPT ); Tue, 26 Aug 2008 15:51:31 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:43822 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753084AbYHZTva (ORCPT ); Tue, 26 Aug 2008 15:51:30 -0400 Date: Tue, 26 Aug 2008 15:51:14 -0400 From: Christoph Hellwig To: Linus Torvalds Cc: Tejun Heo , Ingo Molnar , Al Viro , hch@infradead.org, Linux Kernel Mailing List , Eric Van Hensbergen , Ron Minnich , v9fs-developer@lists.sourceforge.net, cbe-oss-dev@ozlabs.org Subject: Re: [PATCH 2/2] poll: allow f_op->poll to sleep Message-ID: <20080826195114.GB19297@infradead.org> References: <48B40BD4.7040004@kernel.org> <48B40C2F.3050700@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 26, 2008 at 09:58:14AM -0700, Linus Torvalds wrote: > I don't really see the point. > > poll() isn't allowed to sleep for many reasons. Some are technical. But > the most obvious one is that a sleeping "poll()" is totally against the > whole point of polling in the first place! > > So is there some big conceptual reason to change how poll() has always > worked? Just as a little sidenote most files on spufs have a ->poll that sleeps, and currently we don't have any debugging to catch this, I just noticed this by accident. The reason that it sleeps is because it needs to grab a sleping lock, and as that lock protects against a rather complicate type of hardware context switch it's not possible to replace it with a spinlock.