From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964853AbXCOAPr (ORCPT ); Wed, 14 Mar 2007 20:15:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964868AbXCOAPr (ORCPT ); Wed, 14 Mar 2007 20:15:47 -0400 Received: from smtp.osdl.org ([65.172.181.24]:34700 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964862AbXCOAPq (ORCPT ); Wed, 14 Mar 2007 20:15:46 -0400 Date: Wed, 14 Mar 2007 17:15:30 -0700 (PDT) From: Linus Torvalds To: Davide Libenzi cc: Benjamin LaHaise , Linux Kernel Mailing List , Andrew Morton , Ingo Molnar , Suparna Bhattacharya , Zach Brown Subject: Re: [patch 13/13] signalfd/timerfd/asyncfd v5 - KAIO asyncfd support (example/maybe-broken) ... In-Reply-To: Message-ID: References: <20070314231920.GB1246@kvack.org> 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 On Wed, 14 Mar 2007, Davide Libenzi wrote: > > > > That won't work. aio_complete() is supposed to be irq safe. > > Can you point me to a kernel path that ends up calling aio_complete() in a > do-not-sleep mode? All of them. It's called from dio_bio_end_aio(), which is the bi_end_io function for an AIO action. Which in turn is called at IO completion time. Which is basically _always_ interrupt context. So you cannot sleep. It's not about holding spinlocks (which it might well do as well). It's about a much more fundamental issue: you can only sleep in process context, not from interrupts. Linus