Andrea suggested that this might be a mlock bug and someone else
pointed out that madvise instead of mlock exhibits similar behaviour.
So I looked at this code and this patch looks obviously correct:
--- mlock.c.old Sat Nov 3 19:53:43 2001
+++ mlock.c Sat Nov 3 19:55:18 2001
@@ -90,7 +90,6 @@
left->vm_end = start;
right->vm_start = end;
right->vm_pgoff += (right->vm_start - left->vm_start) >> PAGE_SHIFT;
- vma->vm_flags = newflags;
left->vm_raend = 0;
right->vm_raend = 0;
if (vma->vm_file)
This assignment is redundant and it is not protected by any locks.
As far as I can see vma->vm_mm->page_table_lock is supposed to protect
modifications of vma->vm_flags. If this is true we probably need this
as well:
--- filemap.c.old Sat Nov 3 21:44:12 2001
+++ filemap.c Sat Nov 3 21:46:36 2001
@@ -2178,7 +2178,9 @@
if (start == vma->vm_start) {
if (end == vma->vm_end) {
+ spin_lock(&vma->vm_mm->page_table_lock);
setup_read_behavior(vma, behavior);
+ spin_unlock(&vma->vm_mm->page_table_lock);
vma->vm_raend = 0;
} else
error = madvise_fixup_start(vma, end, behavior);
I doubt that this is the reason for the google memory problems, but
who knows?
regards Christian
-- THAT'S ALL FOLKS! - 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/