Thread (47 messages) 47 messages, 7 authors, 2003-05-17

Re: Race between vmtruncate and mapped areas?

From: William Lee Irwin III <hidden>
Date: 2003-05-13 23:08:30
Also in: lkml

On Tuesday, May 13, 2003 16:11:39 -0700 William Lee Irwin III [off-list ref] wrote:
quoted
Okay, what's stopping filemap_nopage() from fetching the page from
pagecache after one of the mm->mmap_sem's is dropped but before
truncate_inode_pages() removes the page? The fault path is only locked
out for one mm during one part of the operation. I can see taking
->i_sem in do_no_page() fixing it, but not ->mmap_sem in vmtruncate()
(but of course that's _far_ too heavy-handed to merge at all).
On Tue, May 13, 2003 at 06:16:16PM -0500, Dave McCracken wrote:
mmap_sem is held for read across the entire fault, so by the time
vmtruncate_list() can call zap_page_range() the page has been instantiated
in the page table and will get removed.
That's not quite the answer, inode->i_size is.

The mmap_sem works because then ->i_size can't be sampled by
filemap_nopage() before the pagetable wiping operation starts.


-- wli
--
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:"aart@kvack.org"> aart@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help