Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141AbXJBSD4 (ORCPT ); Tue, 2 Oct 2007 14:03:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751828AbXJBSDt (ORCPT ); Tue, 2 Oct 2007 14:03:49 -0400 Received: from agminet01.oracle.com ([141.146.126.228]:54240 "EHLO agminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbXJBSDs (ORCPT ); Tue, 2 Oct 2007 14:03:48 -0400 In-Reply-To: <1191271156.5574.9.camel@lappy> References: <20071001195256.GB7718@mami.zabbo.net> <1191271156.5574.9.camel@lappy> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Steven Rostedt , LKML , linux-rt-users , mingo@goodmis.org, Thomas Gleixner Content-Transfer-Encoding: 7bit From: Zach Brown Subject: Re: [HACK] convert i_alloc_sem for direct_io.c craziness! Date: Tue, 2 Oct 2007 11:03:14 -0700 To: Peter Zijlstra X-Mailer: Apple Mail (2.752.3) X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1416 Lines: 45 On Oct 1, 2007, at 1:39 PM, Peter Zijlstra wrote: > > On Mon, 2007-10-01 at 12:52 -0700, Zach Brown wrote: > >> Do you have any suggestions for locking constructs that RT would >> prefer? > > Basically, anything that maps to a simple mutex. Anything more complex > gets real messy real quick. I'm worried that the aio+dio implementation of concurrent pending IOs just doesn't map well to PI. Would a hack with a mutex and counts help at all? It seems like it would still have the same problem. The count increments don't transfer ownership to the count decrements and the wake up. io submission from tasks: down(&inode->i_mutex); atomic_inc(&inode->in_flight); up(&inode->i_mutex); io completion from interrupts: if(atomic_dec_and_test(&inode->in_flight)) wake_up(&inode->waiting); file allocation in tasks: down(&inode->i_mutex); wait_event(inode->waiting, atomic_read(&inode->in_flight) == 0); up(&inode->i_mutex); (yeah, yeah, starvation -- it's just a demonstration) In any case, this seems like it's not a very high priority now that RT has Steven's work-around. If it does become a priority can you guys let linux-fsdevel know? - z - 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/