Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Dec 2008 21:52:18 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186618 - head/sys/vm
Message-ID:  <200812302152.mBULqIUh005918@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Tue Dec 30 21:52:18 2008
New Revision: 186618
URL: http://svn.freebsd.org/changeset/base/186618

Log:
  Avoid an unnecessary memory dereference in vm_map_entry_splay().

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Tue Dec 30 21:49:39 2008	(r186617)
+++ head/sys/vm/vm_map.c	Tue Dec 30 21:52:18 2008	(r186618)
@@ -737,9 +737,9 @@ vm_map_entry_splay(vm_offset_t addr, vm_
 				rlist = root;
 				root = y;
 			}
-		} else {
+		} else if (addr >= root->end) {
 			y = root->right;
-			if (addr < root->end || y == NULL)
+			if (y == NULL)
 				break;
 			if (addr >= y->end && y->right != NULL) {
 				/* Rotate left and put y on llist. */
@@ -755,7 +755,8 @@ vm_map_entry_splay(vm_offset_t addr, vm_
 				llist = root;
 				root = y;
 			}
-		}
+		} else
+			break;
 	}
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812302152.mBULqIUh005918>