Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_map_setup(): We almost ever set up an interrupt-...



details:   https://anonhg.NetBSD.org/src/rev/d675eeb39ab3
branches:  trunk
changeset: 485929:d675eeb39ab3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon May 08 22:59:35 2000 +0000

description:
uvm_map_setup(): We almost ever set up an interrupt-safe map, but we
set up quite a few regular ones (at every fork!), so put interrupt-
safe map setup in the slow path with a __predict_false().

uvm_map_reference(): __predict_false() the check for NULL map.
uvm_map_deallocate(): Likewise.

diffstat:

 sys/uvm/uvm_map_i.h |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r 0f16df371d8b -r d675eeb39ab3 sys/uvm/uvm_map_i.h
--- a/sys/uvm/uvm_map_i.h       Mon May 08 22:48:42 2000 +0000
+++ b/sys/uvm/uvm_map_i.h       Mon May 08 22:59:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map_i.h,v 1.16 1999/07/01 20:07:05 thorpej Exp $   */
+/*     $NetBSD: uvm_map_i.h,v 1.17 2000/05/08 22:59:35 thorpej Exp $   */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -133,8 +133,12 @@
        /*
         * If the map is interrupt safe, place it on the list
         * of interrupt safe maps, for uvm_fault().
+        *
+        * We almost never set up an interrupt-safe map, but we set
+        * up quite a few regular ones (at every fork!), so put
+        * interrupt-safe map setup in the slow path.
         */
-       if (flags & VM_MAP_INTRSAFE) {
+       if (__predict_false(flags & VM_MAP_INTRSAFE)) {
                struct vm_map_intrsafe *vmi = (struct vm_map_intrsafe *)map;
                int s;
 
@@ -193,7 +197,7 @@
 uvm_map_reference(map)
        vm_map_t map;
 {
-       if (map == NULL) {
+       if (__predict_false(map == NULL)) {
 #ifdef DIAGNOSTIC
                printf("uvm_map_reference: reference to NULL map\n");
 #ifdef DDB
@@ -221,7 +225,7 @@
 {
        int c;
 
-       if (map == NULL) {
+       if (__predict_false(map == NULL)) {
 #ifdef DIAGNOSTIC
                printf("uvm_map_deallocate: reference to NULL map\n");
 #ifdef DDB



Home | Main Index | Thread Index | Old Index