From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 11 Oct 2006 09:21:16 -0700 (PDT) From: Linus Torvalds Subject: Re: [patch 2/5] mm: fault vs invalidate/truncate race fix In-Reply-To: <20061010230042.3d4e4df1.akpm@osdl.org> Message-ID: References: <20061010121314.19693.75503.sendpatchset@linux.site> <20061010121332.19693.37204.sendpatchset@linux.site> <20061010213843.4478ddfc.akpm@osdl.org> <452C838A.70806@yahoo.com.au> <20061010230042.3d4e4df1.akpm@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Andrew Morton Cc: Nick Piggin , Nick Piggin , Linux Memory Management , Linux Kernel List-ID: On Tue, 10 Oct 2006, Andrew Morton wrote: > > On Wed, 11 Oct 2006 15:39:22 +1000 > Nick Piggin wrote: > > > But I see that it does read twice. Do you want that behaviour retained? It > > seems like at this level it would be logical to read it once and let lower > > layers take care of any retries? > > argh. Linus has good-sounding reasons for retrying the pagefault-path's > read a single time, but I forget what they are. Something to do with > networked filesystems? (adds cc) Indeed. We _have_ to re-try a failed IO that we didn't start ourselves. The original IO could have been started by a person who didn't have permissions to actually carry it out successfully, so if you enter with the page locked (because somebody else started the IO), and you wait for the page and it's not up-to-date afterwards, you absolutely _have_ to try the IO, and can only return a real IO error after your _own_ IO has failed. There is another issue too: even if the page was marked as having an error when we entered (and no longer locked - maybe the IO failed last time around), we should _still_ re-try. It might be a temporary error that has since gone away, and if we don't re-try, we can end up in the totally untenable situation where the kernel makes a soft error into a hard one. Neither case simply isn't acceptable. End result: only things like read-ahead should actually honor the "page exists but is not up-to-date" as a "don't even try". Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org