From: Nick Piggin <npiggin@suse.de>
To: Linux Memory Management <linux-mm@kvack.org>
Cc: Andrew Morton <akpm@osdl.org>, Dave Airlie <airlied@gmail.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Nick Piggin <npiggin@suse.de>,
thomas@tungstengraphics.com
Subject: [patch 2/7] mm: simplify filemap_nopage
Date: Sat, 13 Jan 2007 04:28:01 +0100 (CET) [thread overview]
Message-ID: <20070113011546.9479.34967.sendpatchset@linux.site> (raw)
In-Reply-To: <20070113011526.9479.79596.sendpatchset@linux.site>
Identical block is duplicated twice: contrary to the comment, we have been
re-reading the page *twice* in filemap_nopage rather than once.
If any retry logic or anything is needed, it belongs in lower levels anyway.
Only retry once. Linus agrees.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Index: linux-2.6/mm/filemap.c
===================================================================
--- linux-2.6.orig/mm/filemap.c
+++ linux-2.6/mm/filemap.c
@@ -1468,30 +1468,6 @@ page_not_uptodate:
majmin = VM_FAULT_MAJOR;
count_vm_event(PGMAJFAULT);
}
- lock_page(page);
-
- /* Did it get unhashed while we waited for it? */
- if (!page->mapping) {
- unlock_page(page);
- page_cache_release(page);
- goto retry_all;
- }
-
- /* Did somebody else get it up-to-date? */
- if (PageUptodate(page)) {
- unlock_page(page);
- goto success;
- }
-
- error = mapping->a_ops->readpage(file, page);
- if (!error) {
- wait_on_page_locked(page);
- if (PageUptodate(page))
- goto success;
- } else if (error == AOP_TRUNCATED_PAGE) {
- page_cache_release(page);
- goto retry_find;
- }
/*
* Umm, take care of errors if the page isn't up-to-date.
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-01-13 3:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-13 3:27 [patch 0/7] fault vs truncate/invalidate race fix Nick Piggin
2007-01-13 3:27 ` [patch 1/7] mm: debug check for the fault vs invalidate race Nick Piggin
2007-01-13 3:28 ` Nick Piggin [this message]
2007-01-13 3:28 ` [patch 3/7] mm: fix fault vs invalidate race for linear mappings Nick Piggin
2007-01-13 3:28 ` [patch 4/7] mm: merge populate and nopage into fault (fixes nonlinear) Nick Piggin
2007-01-13 3:28 ` [patch 5/7] mm: add vm_insert_pfn Nick Piggin
2007-01-13 3:28 ` [patch 6/7] mm: merge nopfn into fault Nick Piggin
2007-01-13 3:29 ` [patch 7/7] mm: remove legacy cruft Nick Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070113011546.9479.34967.sendpatchset@linux.site \
--to=npiggin@suse.de \
--cc=airlied@gmail.com \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=thomas@tungstengraphics.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).