linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasmus Andersen <rasmus@jaquet.dk>
To: linux-kernel@vger.kernel.org
Subject: [uPATCH] Nulling mmap_cache iff needed (2.4.0)
Date: Wed, 10 Jan 2001 21:57:01 +0100	[thread overview]
Message-ID: <20010110215701.D971@jaquet.dk> (raw)

Hi.

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.

Comments?


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. */
+
 	spin_unlock(&mm->page_table_lock);
 
 	/* Ok - we have the memory areas we should free on the 'free' list,


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

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

                 reply	other threads:[~2001-01-10 20:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010110215701.D971@jaquet.dk \
    --to=rasmus@jaquet.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).