allow the sizes of the maphist and pdhist to be set in the config

file via UVMHIST_MAPHIST_SIZE and UVMHIST_PDHIST_SIZE.
This commit is contained in:
mrg 2016-12-01 02:09:03 +00:00
parent 97d7454638
commit 07b8fffc31
2 changed files with 12 additions and 5 deletions

View File

@ -1,10 +1,11 @@
# $NetBSD: files.uvm,v 1.26 2016/08/12 13:40:21 skrll Exp $
# $NetBSD: files.uvm,v 1.27 2016/12/01 02:09:03 mrg Exp $
#
# UVM options
#
defflag opt_uvmhist.h UVMHIST: KERNHIST
defflag opt_uvmhist.h UVMHIST_PRINT: KERNHIST_PRINT
defparam opt_uvmhist.h UVMHIST_MAPHIST_SIZE UVMHIST_PDHIST_SIZE
defflag opt_uvm.h USE_TOPDOWN_VM UVMMAP_COUNTERS
defparam opt_uvm.h UVM_RESERVED_PAGES_PER_CPU
defflag opt_vmswap.h VMSWAP

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.c,v 1.341 2016/08/06 15:13:14 maxv Exp $ */
/* $NetBSD: uvm_map.c,v 1.342 2016/12/01 02:09:03 mrg Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.341 2016/08/06 15:13:14 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.342 2016/12/01 02:09:03 mrg Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@ -100,7 +100,13 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.341 2016/08/06 15:13:14 maxv Exp $");
#endif
#ifdef UVMHIST
static struct kern_history_ent maphistbuf[100];
#ifndef UVMHIST_MAPHIST_SIZE
#define UVMHIST_MAPHIST_SIZE 100
#endif
#ifndef UVMHIST_PDHIST_SIZE
#define UVMHIST_PDHIST_SIZE 100
#endif
static struct kern_history_ent maphistbuf[UVMHIST_MAPHIST_SIZE];
UVMHIST_DEFINE(maphist) = UVMHIST_INITIALIZER(maphist, maphistbuf);
#endif
@ -884,7 +890,7 @@ void
uvm_map_init(void)
{
#if defined(UVMHIST)
static struct kern_history_ent pdhistbuf[100];
static struct kern_history_ent pdhistbuf[UVMHIST_PDHIST_SIZE];
#endif
/*