[lkml]   [2001]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[uPATCH] Nulling mmap_cache iff needed (2.4.0)

The following (trivial) patch against 2.4.0 (but should apply cleanly
against 241p1) makes do_munmap only null our precious cache if the
pointer contained therein is invalidated by the unmapping. I doubt it
will make any measurable difference but it seems straightforward
enough to be done anyway.

Running kernel compiles and starting X/gnome with this patch raises my
cache hit rate a couple of percentage points, and I have a feeling that
there might be work loads out there that hit this kernel path more often
that these.


diff -aur linux-2.4.0-clean/mm/mmap.c linux/mm/mmap.c
--- linux-2.4.0-clean/mm/mmap.c Sat Dec 30 18:35:19 2000
+++ linux/mm/mmap.c Tue Jan 9 23:30:03 2001
@@ -712,7 +712,10 @@
if (mm->mmap_avl)
avl_remove(mpnt, &mm->mmap_avl);
- mm->mmap_cache = NULL; /* Kill the cache. */
+ if (mm->mmap_cache && mm->mmap_cache->vm_start < addr+len
+ && mm->mmap_cache->vm_end > addr)
+ mm->mmap_cache = NULL; /* Kill the cache. */

/* Ok - we have the memory areas we should free on the 'free' list,


"It's like an Alcatraz around my neck."
-Boston mayor Menino on the shortage of city parking spaces
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.026 / U:6.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site