changeset 13673:622cc2de0163

2638 page coalescing can dissociate locked pages from their pfn Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Milan Jurik <jurikm@xylab.cz> Reviewed by: Theo Schlossnagle <jesus@omniti.com> Reviewed by: Gordon Ross <gwr@nexenta.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Eric Schrock <eric.schrock@delphix.com>
author Bryan Cantrill <bryan@joyent.com>
date Wed, 28 Mar 2012 19:18:04 +0000
parents bc588248a482
children 181ba6c41bee
files usr/src/uts/common/vm/vm_pagelist.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/vm/vm_pagelist.c	Wed Apr 18 22:20:23 2012 +0000
+++ b/usr/src/uts/common/vm/vm_pagelist.c	Wed Mar 28 19:18:04 2012 +0000
@@ -22,6 +22,10 @@
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
+/*
+ * Copyright 2012 Joyent, Inc.  All rights reserved.
+ */
+
 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
 /*	All Rights Reserved   */
 
@@ -3181,7 +3185,14 @@
 			page_unlock_nocapture(pp);
 			return (0);
 		}
-		if (PP_ISNORELOC(pp)) {
+
+		/*
+		 * If a page has been marked non-relocatable or has been
+		 * explicitly locked in memory, we don't want to relocate it;
+		 * unlock the pages and fail the operation.
+		 */
+		if (PP_ISNORELOC(pp) ||
+		    pp->p_lckcnt != 0 || pp->p_cowcnt != 0) {
 			VM_STAT_ADD(vmm_vmstats.ptcpfailcage[szc]);
 			while (i != (pgcnt_t)-1) {
 				pp = &spp[i];