Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 May 2014 08:19:05 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266491 - head/sys/vm
Message-ID:  <201405210819.s4L8J52M080525@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed May 21 08:19:04 2014
New Revision: 266491
URL: http://svnweb.freebsd.org/changeset/base/266491

Log:
  Remove redundand loop.  The inner goto restarts the whole page
  handling in the situation identical to the loop condition.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 days

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Wed May 21 08:09:44 2014	(r266490)
+++ head/sys/vm/vm_fault.c	Wed May 21 08:19:04 2014	(r266491)
@@ -1351,18 +1351,16 @@ again:
 			/*
 			 * Allocate a page in the destination object.
 			 */
-			do {
-				dst_m = vm_page_alloc(dst_object,
-				    (src_object == dst_object ? src_pindex :
-				    0) + dst_pindex, VM_ALLOC_NORMAL);
-				if (dst_m == NULL) {
-					VM_OBJECT_WUNLOCK(dst_object);
-					VM_OBJECT_RUNLOCK(object);
-					VM_WAIT;
-					VM_OBJECT_WLOCK(dst_object);
-					goto again;
-				}
-			} while (dst_m == NULL);
+			dst_m = vm_page_alloc(dst_object, (src_object ==
+			    dst_object ? src_pindex : 0) + dst_pindex,
+			    VM_ALLOC_NORMAL);
+			if (dst_m == NULL) {
+				VM_OBJECT_WUNLOCK(dst_object);
+				VM_OBJECT_RUNLOCK(object);
+				VM_WAIT;
+				VM_OBJECT_WLOCK(dst_object);
+				goto again;
+			}
 			pmap_copy_page(src_m, dst_m);
 			VM_OBJECT_RUNLOCK(object);
 			dst_m->valid = VM_PAGE_BITS_ALL;



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