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:03:32
Also in: lkml

On Tuesday, May 13, 2003 15:49:29 -0700 William Lee Irwin III [off-list ref] wrote:
quoted
That doesn't sound like it's going to help, there isn't a unique
mmap_sem to be taken and so we just get caught between acquisitions
with the same problem.
On Tue, May 13, 2003 at 06:00:08PM -0500, Dave McCracken wrote:
Actually it does fix it.  I added code in vmtruncate_list() to do a
down_write(&vma->vm_mm->mmap_sem) around the zap_page_range(), and the
problem went away.  It serializes against any outstanding page faults on a
particular page table.  New faults will see that the page is no longer in
the file and fail with SIGBUS.  Andrew's test case stopped failing.
I've attached the patch so you can see what I did.
Can anyone think of any gotchas to this solution?
How many processes are you doing this with? If it's a small number can
you try it with 1000 or so?


-- 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