Skip to contentSkip to conversation

limit mmap_cache nulling (2.2.19-7)

PATCH New Rasmus Andersen 1 participant 1 message Jan 14, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 limit mmap_cache nulling (2.2.19-7)

Hi.

The following patch against 2.2.19-7 adds checks in do_munmap and merge_segments to limit the nulling of mmap_cache to the cases where the cached vma is in the affected area.

Comments?

mm/mmap.c renamed from mm/mmap.c~ +7 -2
@@ -689,8 +689,11 @@
 		kmem_cache_free(vm_area_cachep, extra);
 
 	free_pgtables(mm, prev, addr, addr+len);
+		
+	if (mm->mmap_cache && mm->mmap_cache->vm_start < addr+len 
+	    && mm->mmap_cache->vm_end > addr)
+		mm->mmap_cache = NULL;	/* Kill the cache. */
 
-	mm->mmap_cache = NULL;	/* Kill the cache. */
 	return 0;
 }
 
@@ -867,7 +870,9 @@
 		kmem_cache_free(vm_area_cachep, mpnt);
 		mpnt = prev;
 	}
-	mm->mmap_cache = NULL;		/* Kill the cache. */
+       if (mm->mmap_cache && mm->mmap_cache->vm_start < end_addr 
+           && mm->mmap_cache->vm_end > start_addr)
+	       mm->mmap_cache = NULL;		/* Kill the cache. */
 }
 
 void __init vma_init(void)
Signature · 11 lines
Regards,
        Rasmus([email protected])

Are they taking DDT?
                -- Vice President Dan Quayle asking doctors at a Manhattan
                   AIDS clinic about their treatments of choice, 4/30/92
                   (reported in Esquire, 8/92, and NY Post early May 92)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/