Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757277AbZDNRyA (ORCPT ); Tue, 14 Apr 2009 13:54:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751560AbZDNRxt (ORCPT ); Tue, 14 Apr 2009 13:53:49 -0400 Received: from mx2.redhat.com ([66.187.237.31]:48588 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbZDNRxs (ORCPT ); Tue, 14 Apr 2009 13:53:48 -0400 Date: Tue, 14 Apr 2009 19:51:24 +0200 From: Andrea Arcangeli To: Jeff Moyer Cc: KOSAKI Motohiro , LKML , Linus Torvalds , Andrew Morton , Nick Piggin , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Hugh Dickins , Zach Brown , Andy Grover Subject: Re: [RFC][PATCH v3 2/6] mm, directio: fix fork vs direct-io race (read(2) side IOW gup(write) side) Message-ID: <20090414175124.GC9809@random.random> References: <20090414151204.C647.A69D9226@jp.fujitsu.com> <20090414151652.C64D.A69D9226@jp.fujitsu.com> <20090414152500.C65F.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1324 Lines: 24 On Tue, Apr 14, 2009 at 12:45:41PM -0400, Jeff Moyer wrote: > So, if you're continuously submitting async read I/O, you will starve > out the fork() call indefinitely. I agree that you want to allow IIRC rwsem good enough to stop the down_read when a down_write is blocked. Otherwise page fault flood in threads would also starve any mmap or similar call. Still with this approach fork will start to hang indefinitely waiting for I/O, making it an I/O bound call, and not a CPU call anymore, which may severely impact interactive-ness of applications. As long as fork is useful in the first place to provide memory protection of different code with different memory-corruption-trust-levels (otherwise nobody should use fork at all, and vfork [or better spawn] should become the only option), then fork from a thread pool is also reasonable. Either fork is totally useless as a whole (which I wouldn't argue too much about), or if you agree fork makes any sense, it can also make sense if intermixed with clone(CLONE_VM) and hopefully it should behave CPU bound like CLONE_VM. -- 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/