Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm uvm_unloanpage(): fix a screwup in previous. slock ...



details:   https://anonhg.NetBSD.org/src/rev/6289fef58e8d
branches:  trunk
changeset: 969620:6289fef58e8d
user:      ad <ad%NetBSD.org@localhost>
date:      Mon Feb 24 21:06:11 2020 +0000

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

diffstat:

 sys/uvm/uvm_loan.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 76898a86025c -r 6289fef58e8d sys/uvm/uvm_loan.c
--- a/sys/uvm/uvm_loan.c        Mon Feb 24 20:53:11 2020 +0000
+++ b/sys/uvm/uvm_loan.c        Mon Feb 24 21:06:11 2020 +0000
@@ -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 @@
                        }
                        /* XXX Better than yielding but inadequate. */
                        kpause("livelock", false, 1, &pg->interlock);
+                       slock = NULL;
                }
 
                /*
@@ -1015,7 +1016,9 @@
                        KASSERT((pg->flags & PG_BUSY) == 0);
                        uvm_pagefree(pg);
                }
-               rw_exit(slock);
+               if (slock != NULL) {
+                       rw_exit(slock);
+               }
        }
 }
 



Home | Main Index | Thread Index | Old Index