Module Name:    src
Committed By:   ad
Date:           Mon Feb 24 21:06:11 UTC 2020

Modified Files:
        src/sys/uvm: uvm_loan.c

Log Message:
uvm_unloanpage(): fix a screwup in previous.  slock must be set NULL if
it can't be acquired.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/uvm/uvm_loan.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_loan.c
diff -u src/sys/uvm/uvm_loan.c:1.95 src/sys/uvm/uvm_loan.c:1.96
--- src/sys/uvm/uvm_loan.c:1.95	Sun Feb 23 15:46:43 2020
+++ src/sys/uvm/uvm_loan.c	Mon Feb 24 21:06:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.95 2020/02/23 15:46:43 ad Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.96 2020/02/24 21:06:11 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.95 2020/02/23 15:46:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.96 2020/02/24 21:06:11 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -988,6 +988,7 @@ uvm_unloanpage(struct vm_page **ploans, 
 			}
 			/* XXX Better than yielding but inadequate. */
 			kpause("livelock", false, 1, &pg->interlock);
+			slock = NULL;
 		}
 
 		/*
@@ -1015,7 +1016,9 @@ uvm_unloanpage(struct vm_page **ploans, 
 			KASSERT((pg->flags & PG_BUSY) == 0);
 			uvm_pagefree(pg);
 		}
-		rw_exit(slock);
+		if (slock != NULL) {
+			rw_exit(slock);
+		}
 	}
 }
 

Reply via email to