summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2011-07-03 18:36:52 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2011-07-03 18:36:52 +0000
commit5638f6840d03533dc723bad5ca0bb1044caeeff6 (patch)
treee5a2bc698d7a538541f69b1733ebedd89d8c883b /sys
parent9ab2af9380379bf897461fdb1e4d46997af234e1 (diff)
endodoify UVM_CNT too.
``beat it'' tedu@ the deleteotron
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm.h4
-rw-r--r--sys/uvm/uvm_map.c37
-rw-r--r--sys/uvm/uvm_stat.c29
-rw-r--r--sys/uvm/uvm_stat.h96
4 files changed, 4 insertions, 162 deletions
diff --git a/sys/uvm/uvm.h b/sys/uvm/uvm.h
index c33fc983c38..561552b03cb 100644
--- a/sys/uvm/uvm.h
+++ b/sys/uvm/uvm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm.h,v 1.44 2011/07/03 18:34:14 oga Exp $ */
+/* $OpenBSD: uvm.h,v 1.45 2011/07/03 18:36:49 oga Exp $ */
/* $NetBSD: uvm.h,v 1.24 2000/11/27 08:40:02 chs Exp $ */
/*
@@ -40,8 +40,6 @@
#include <uvm/uvm_extern.h>
-#include <uvm/uvm_stat.h>
-
/*
* pull in prototypes
*/
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 06f971f4292..b9f97c60359 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.143 2011/07/03 18:34:14 oga Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.144 2011/07/03 18:36:49 oga Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -96,9 +96,6 @@
static struct timeval uvm_kmapent_last_warn_time;
static struct timeval uvm_kmapent_warn_rate = { 10, 0 };
-struct uvm_cnt uvm_map_call, map_backmerge, map_forwmerge;
-struct uvm_cnt map_nousermerge;
-struct uvm_cnt uvm_mlk_call, uvm_mlk_hint;
const char vmmapbsy[] = "vmmapbsy";
/*
@@ -527,20 +524,7 @@ uvm_map_init(void)
int lcv;
/*
- * first, init logging system.
- */
-
- UVMCNT_INIT(uvm_map_call, UVMCNT_CNT, 0,
- "# uvm_map() successful calls", 0);
- UVMCNT_INIT(map_backmerge, UVMCNT_CNT, 0, "# uvm_map() back merges", 0);
- UVMCNT_INIT(map_forwmerge, UVMCNT_CNT, 0, "# uvm_map() missed forward",
- 0);
- UVMCNT_INIT(map_nousermerge, UVMCNT_CNT, 0, "# back merges skipped", 0);
- UVMCNT_INIT(uvm_mlk_call, UVMCNT_CNT, 0, "# map lookup calls", 0);
- UVMCNT_INIT(uvm_mlk_hint, UVMCNT_CNT, 0, "# map lookup hint hits", 0);
-
- /*
- * now set up static pool of kernel map entries ...
+ * set up static pool of kernel map entries ...
*/
simple_lock_init(&uvm.kentry_lock);
@@ -799,8 +783,6 @@ uvm_map_p(struct vm_map *map, vaddr_t *startp, vsize_t size,
}
#endif
- UVMCNT_INCR(uvm_map_call);
-
/*
* if uobj is null, then uoffset is either a VAC hint for PMAP_PREFER
* [typically from uvm_map_reserve] or it is UVM_UNKNOWN_OFFSET. in
@@ -872,7 +854,6 @@ uvm_map_p(struct vm_map *map, vaddr_t *startp, vsize_t size,
* of how much we skipped.
*/
if (map != kernel_map && map != kmem_map) {
- UVMCNT_INCR(map_nousermerge);
goto step3;
}
@@ -882,8 +863,6 @@ uvm_map_p(struct vm_map *map, vaddr_t *startp, vsize_t size,
goto step3;
}
- UVMCNT_INCR(map_backmerge);
-
/*
* drop our reference to uobj since we are extending a reference
* that we already have (the ref count can not drop to zero).
@@ -907,16 +886,6 @@ uvm_map_p(struct vm_map *map, vaddr_t *startp, vsize_t size,
step3:
/*
- * check for possible forward merge (which we don't do) and count
- * the number of times we missed a *possible* chance to merge more
- */
-
- if ((flags & UVM_FLAG_NOMERGE) == 0 &&
- prev_entry->next != &map->header &&
- prev_entry->next->start == (*startp + size))
- UVMCNT_INCR(map_forwmerge);
-
- /*
* step 3: allocate new entry and link it in
*/
@@ -1043,7 +1012,6 @@ uvm_map_lookup_entry(struct vm_map *map, vaddr_t address,
if (cur == &map->header)
cur = cur->next;
- UVMCNT_INCR(uvm_mlk_call);
if (address >= cur->start) {
/*
* go from hint to end of list.
@@ -1058,7 +1026,6 @@ uvm_map_lookup_entry(struct vm_map *map, vaddr_t address,
*/
last = &map->header;
if ((cur != last) && (cur->end > address)) {
- UVMCNT_INCR(uvm_mlk_hint);
*entry = cur;
return (TRUE);
}
diff --git a/sys/uvm/uvm_stat.c b/sys/uvm/uvm_stat.c
index 040b8dfb96c..a945cf48ede 100644
--- a/sys/uvm/uvm_stat.c
+++ b/sys/uvm/uvm_stat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_stat.c,v 1.24 2011/07/03 18:34:14 oga Exp $ */
+/* $OpenBSD: uvm_stat.c,v 1.25 2011/07/03 18:36:51 oga Exp $ */
/* $NetBSD: uvm_stat.c,v 1.18 2001/03/09 01:02:13 chs Exp $ */
/*
@@ -45,36 +45,9 @@
#include <uvm/uvm.h>
#include <uvm/uvm_ddb.h>
-/*
- * globals
- */
-
-struct uvm_cnt *uvm_cnt_head = NULL;
-
-
#ifdef DDB
/*
- * prototypes
- */
-
-void uvmcnt_dump(void);
-
-
-void
-uvmcnt_dump(void)
-{
- struct uvm_cnt *uvc = uvm_cnt_head;
-
- while (uvc) {
- if ((uvc->t & UVMCNT_MASK) != UVMCNT_CNT)
- continue;
- printf("%s = %d\n", uvc->name, uvc->c);
- uvc = uvc->next;
- }
-}
-
-/*
* uvmexp_print: ddb hook to print interesting uvm counters
*/
void
diff --git a/sys/uvm/uvm_stat.h b/sys/uvm/uvm_stat.h
deleted file mode 100644
index c92ba6b0a19..00000000000
--- a/sys/uvm/uvm_stat.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $OpenBSD: uvm_stat.h,v 1.16 2011/07/03 18:34:14 oga Exp $ */
-/* $NetBSD: uvm_stat.h,v 1.19 2001/02/04 10:55:58 mrg Exp $ */
-
-/*
- *
- * Copyright (c) 1997 Charles D. Cranor and Washington University.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Charles D. Cranor and
- * Washington University.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * from: Id: uvm_stat.h,v 1.1.2.4 1998/02/07 01:16:56 chs Exp
- */
-
-#ifndef _UVM_UVM_STAT_H_
-#define _UVM_UVM_STAT_H_
-
-#include <sys/queue.h>
-
-/*
- * uvm_stat: monitor what is going on with uvm (or whatever)
- */
-
-/*
- * counters [XXX: maybe replace event counters with this]
- */
-
-#define UVMCNT_MASK 0xf /* rest are private */
-#define UVMCNT_CNT 0 /* normal counter */
-#define UVMCNT_DEV 1 /* device event counter */
-
-struct uvm_cnt {
- int c; /* the value */
- int t; /* type */
- struct uvm_cnt *next; /* global list of cnts */
- char *name; /* counter name */
- void *p; /* private data */
-};
-
-#ifdef _KERNEL
-
-extern struct uvm_cnt *uvm_cnt_head;
-
-/*
- * counter operations. assume spl is set ok.
- */
-
-#define UVMCNT_INIT(CNT,TYP,VAL,NAM,PRIV) \
-do { \
- CNT.c = VAL; \
- CNT.t = TYP; \
- CNT.next = uvm_cnt_head; \
- uvm_cnt_head = &CNT; \
- CNT.name = NAM; \
- CNT.p = PRIV; \
-} while (0)
-
-#define UVMCNT_SET(C,V) \
-do { \
- (C).c = (V); \
-} while (0)
-
-#define UVMCNT_ADD(C,V) \
-do { \
- (C).c += (V); \
-} while (0)
-
-#define UVMCNT_INCR(C) UVMCNT_ADD(C,1)
-#define UVMCNT_DECR(C) UVMCNT_ADD(C,-1)
-
-#endif /* _KERNEL */
-
-#endif /* _UVM_UVM_STAT_H_ */