Module Name:    src
Committed By:   martin
Date:           Sat Dec 23 13:08:50 UTC 2023

Modified Files:
        src/sys/arch/vax/vax [netbsd-10]: pmap.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #516):

        sys/arch/vax/vax/pmap.c: revision 1.199

fix locking botch: use mutex_spin_exit(), not _exit(), for PMAP_UNLOCK.
fixes LOCKDEBUG issue in first attempt to unlock it.

also call PMAP_UNLOCK in one non-fatal out of memory case.


To generate a diff of this commit:
cvs rdiff -u -r1.195.2.2 -r1.195.2.3 src/sys/arch/vax/vax/pmap.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/arch/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.195.2.2 src/sys/arch/vax/vax/pmap.c:1.195.2.3
--- src/sys/arch/vax/vax/pmap.c:1.195.2.2	Sat Dec 23 13:06:43 2023
+++ src/sys/arch/vax/vax/pmap.c	Sat Dec 23 13:08:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.195.2.2 2023/12/23 13:06:43 martin Exp $	   */
+/*	$NetBSD: pmap.c,v 1.195.2.3 2023/12/23 13:08:50 martin Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195.2.2 2023/12/23 13:06:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195.2.3 2023/12/23 13:08:50 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -159,7 +159,7 @@ ptpinuse(void *pte)
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
 static kmutex_t pmap_lock;
 #define PMAP_LOCK	mutex_spin_enter(&pmap_lock);
-#define PMAP_UNLOCK	mutex_spin_enter(&pmap_lock);
+#define PMAP_UNLOCK	mutex_spin_exit(&pmap_lock);
 #else
 #define PMAP_LOCK
 #define PMAP_UNLOCK
@@ -1197,6 +1197,7 @@ pmap_enter(pmap_t pmap, vaddr_t v, paddr
 	return 0;
 
 growfail:
+	PMAP_UNLOCK;
 	if (flags & PMAP_CANFAIL)
 		return ENOMEM;
 	panic("usrptmap space leakage");

Reply via email to