Source-Changes-HG archive

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

[src/trunk]: src/sys/vm Keep interrupt-safe maps on an additional queue. In ...



details:   https://anonhg.NetBSD.org/src/rev/29f33a95ae8b
branches:  trunk
changeset: 473460:29f33a95ae8b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jun 05 04:12:31 1999 +0000

description:
Keep interrupt-safe maps on an additional queue.  In uvm_fault(), if we're
looking up a kernel address, check to see if the address is on this
"interrupt-safe" list.  If so, return failure immediately.  This prevents
a locking screw if a page fault is taken on an interrupt-safe map in or
out of interrupt context.

diffstat:

 sys/vm/vm_map.h |  39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diffs (53 lines):

diff -r e2d58ad92bf8 -r 29f33a95ae8b sys/vm/vm_map.h
--- a/sys/vm/vm_map.h   Sat Jun 05 03:16:19 1999 +0000
+++ b/sys/vm/vm_map.h   Sat Jun 05 04:12:31 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_map.h,v 1.26 1999/05/28 20:31:42 thorpej Exp $      */
+/*     $NetBSD: vm_map.h,v 1.27 1999/06/05 04:12:31 thorpej Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -151,6 +151,43 @@
 #define        VM_MAP_INTRSAFE         0x02            /* interrupt safe map */
 
 /*
+ *     Interrupt-safe maps must also be kept on a special list,
+ *     to assist uvm_fault() in avoiding locking problems.
+ */
+struct vm_map_intrsafe {
+       struct vm_map   vmi_map;
+       LIST_ENTRY(vm_map_intrsafe) vmi_list;
+};
+
+LIST_HEAD(vmi_list, vm_map_intrsafe);
+#ifdef _KERNEL
+extern simple_lock_data_t vmi_list_slock;
+extern struct vmi_list vmi_list;
+
+static __inline int vmi_list_lock __P((void));
+static __inline void vmi_list_unlock __P((int));
+
+static __inline int
+vmi_list_lock()
+{
+       int s;
+
+       s = splhigh();
+       simple_lock(&vmi_list_slock);
+       return (s);
+}
+
+static __inline void
+vmi_list_unlock(s)
+       int s;
+{
+
+       simple_unlock(&vmi_list_slock);
+       splx(s);
+}
+#endif /* _KERNEL */
+
+/*
  * VM map locking operations:
  *
  *     These operations perform locking on the data portion of the



Home | Main Index | Thread Index | Old Index