public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] limit mmap_cache nulling (2.2.19-7)
@ 2001-01-14 13:16 Rasmus Andersen
  0 siblings, 0 replies; only message in thread
From: Rasmus Andersen @ 2001-01-14 13:16 UTC (permalink / raw)
  To: linux-kernel

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?


--- linux-2.2.19-7/mm/mmap.c~	Sun Jan 14 13:43:50 2001
+++ linux-2.2.19-7/mm/mmap.c	Sun Jan 14 14:02:04 2001
@@ -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)

-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-14 13:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-14 13:16 [PATCH] limit mmap_cache nulling (2.2.19-7) Rasmus Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox