diff options
| author | 2016-10-21 06:27:50 +0000 | |
|---|---|---|
| committer | 2016-10-21 06:27:50 +0000 | |
| commit | 04e271afd236a4e788ea5f35c3ff6ba63689e51a (patch) | |
| tree | 04b8e46a84a01d1ba20732f5ceb66f94b7a555eb /sys/kern/init_main.c | |
| parent | vmm(4) for i386. Userland changes forthcoming. Note that for the time being, (diff) | |
| download | wireguard-openbsd-04e271afd236a4e788ea5f35c3ff6ba63689e51a.tar.xz wireguard-openbsd-04e271afd236a4e788ea5f35c3ff6ba63689e51a.zip | |
add generalised access to per cpu data structures and counters.
both the cpumem and counters api simply allocates memory for each cpu in
the system that can be used for arbitrary per cpu data (via cpumem), or
a versioned set of counters per cpu (counters).
there is an alternate backend for uniprocessor systems that basically
turns the percpu data access into an immediate access to a single
allocation.
there is also support for percpu data structures that are available at
boot time by providing an allocation for the boot cpu. after autoconf,
these allocations have to be resized to provide for all cpus that were
enumerated by boot.
ok mpi@
Diffstat (limited to 'sys/kern/init_main.c')
| -rw-r--r-- | sys/kern/init_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f781069a92e..d65e00cfa82 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.259 2016/09/22 12:55:24 mpi Exp $ */ +/* $OpenBSD: init_main.c,v 1.260 2016/10/21 06:27:50 dlg Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -146,6 +146,7 @@ void kqueue_init(void); void taskq_init(void); void timeout_proc_init(void); void pool_gc_pages(void *); +void percpu_init(void); extern char sigcode[], esigcode[], sigcoderet[]; #ifdef SYSCALL_DEBUG @@ -360,6 +361,9 @@ main(void *framep) /* Configure virtual memory system, set vm rlimits. */ uvm_init_limits(p); + /* Per CPU memory allocation */ + percpu_init(); + /* Initialize the file systems. */ #if defined(NFSSERVER) || defined(NFSCLIENT) nfs_init(); /* initialize server/shared data */ |
