diff options
| author | Luigi Rizzo <luigi@FreeBSD.org> | 2001-12-01 00:21:30 +0000 |
|---|---|---|
| committer | Luigi Rizzo <luigi@FreeBSD.org> | 2001-12-01 00:21:30 +0000 |
| commit | 60363fb9f79a74440348d9ea5d505444e2028c90 (patch) | |
| tree | b2cd7f1acb9a18f381d1ffac6483f7fb5bdb129a | |
| parent | 33cc94ddaf5b9b388f5206dd47506876ad61a1c0 (diff) | |
Notes
| -rw-r--r-- | sys/kern/subr_mbuf.c | 15 | ||||
| -rw-r--r-- | sys/vm/vm_kern.c | 10 |
2 files changed, 22 insertions, 3 deletions
diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c index 596319d091c2..7c4ab83d0f66 100644 --- a/sys/kern/subr_mbuf.c +++ b/sys/kern/subr_mbuf.c @@ -621,9 +621,22 @@ mb_alloc(struct mb_lstmngr *mb_list, int how, short type) * steal from other lists. */ m = mb_alloc_wait(mb_list, type); - } else + } else { + /* + * no way to indent this code decently + * with 8-space tabs. + */ + static int last_report; /* XXX: No consistency. */ mbstat.m_drops++; + if (ticks < last_report || + (ticks - last_report) >= hz) { + last_report = ticks; + printf( +"mb_alloc for type %d failed, consider increase mbuf value.\n", type); + } + + } } } } diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 7ab7c08d783c..2e5ea304a627 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -70,6 +70,7 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/kernel.h> /* for ticks and hz */ #include <sys/lock.h> #include <sys/mutex.h> #include <sys/proc.h> @@ -331,8 +332,13 @@ kmem_malloc(map, size, flags) if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { vm_map_unlock(map); if (map != kmem_map) { - printf("Out of mbuf address space!\n"); - printf("Consider increasing NMBCLUSTERS\n"); + static int last_report; /* when we did it (in ticks) */ + if (ticks < last_report || + (ticks - last_report) >= hz) { + last_report = ticks; + printf("Out of mbuf address space!\n"); + printf("Consider increasing NMBCLUSTERS\n"); + } goto bad; } if ((flags & M_NOWAIT) == 0) |
