From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1Hc2EY-0002AY-D8 for user-mode-linux-devel@lists.sourceforge.net; Thu, 12 Apr 2007 09:33:18 -0700 Received: from [198.99.130.12] (helo=saraswathi.solana.com) by mail.sourceforge.net with esmtp (Exim 4.44) id 1Hc2EX-0000fi-Q8 for user-mode-linux-devel@lists.sourceforge.net; Thu, 12 Apr 2007 09:33:18 -0700 Date: Thu, 12 Apr 2007 12:28:05 -0400 From: Jeff Dike Message-ID: <20070412162805.GA7250@c2.user-mode-linux.org> Mime-Version: 1.0 Content-Disposition: inline Subject: [uml-devel] [ PATCH 5/6 ] UML - AIO deadlock avoidance List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: user-mode-linux-devel-bounces@lists.sourceforge.net Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net To: Andrew Morton Cc: LKML , uml-devel Allow deadlocks to be avoided in the AIO code by setting the pipe to the I/O thread non-blocking. Signed-off-by: Jeff Dike -- arch/um/os-Linux/aio.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6.21-mm/arch/um/os-Linux/aio.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/os-Linux/aio.c 2007-04-12 11:34:40.000000000 -0400 +++ linux-2.6.21-mm/arch/um/os-Linux/aio.c 2007-04-12 11:47:14.000000000 -0400 @@ -221,6 +221,11 @@ static int init_aio_24(void) aio_req_fd_w = fds[0]; aio_req_fd_r = fds[1]; + + err = os_set_fd_block(aio_req_fd_w, 0); + if(err) + goto out_close_pipe; + err = run_helper_thread(not_aio_thread, NULL, CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0); if(err < 0) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751052AbXDLQdZ (ORCPT ); Thu, 12 Apr 2007 12:33:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751122AbXDLQdZ (ORCPT ); Thu, 12 Apr 2007 12:33:25 -0400 Received: from saraswathi.solana.com ([198.99.130.12]:50715 "EHLO saraswathi.solana.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbXDLQdY (ORCPT ); Thu, 12 Apr 2007 12:33:24 -0400 Date: Thu, 12 Apr 2007 12:28:05 -0400 From: Jeff Dike To: Andrew Morton Cc: LKML , uml-devel Subject: [ PATCH 5/6 ] UML - AIO deadlock avoidance Message-ID: <20070412162805.GA7250@c2.user-mode-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Allow deadlocks to be avoided in the AIO code by setting the pipe to the I/O thread non-blocking. Signed-off-by: Jeff Dike -- arch/um/os-Linux/aio.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6.21-mm/arch/um/os-Linux/aio.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/os-Linux/aio.c 2007-04-12 11:34:40.000000000 -0400 +++ linux-2.6.21-mm/arch/um/os-Linux/aio.c 2007-04-12 11:47:14.000000000 -0400 @@ -221,6 +221,11 @@ static int init_aio_24(void) aio_req_fd_w = fds[0]; aio_req_fd_r = fds[1]; + + err = os_set_fd_block(aio_req_fd_w, 0); + if(err) + goto out_close_pipe; + err = run_helper_thread(not_aio_thread, NULL, CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0); if(err < 0)