summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pcpu.c
diff options
context:
space:
mode:
authorups <ups@FreeBSD.org>2007-11-08 14:47:55 +0000
committerups <ups@FreeBSD.org>2007-11-08 14:47:55 +0000
commit9c75ede409d60f494cbb4b5c953e103ca672a0df (patch)
treee657852bc96f8f77553f7abb0596889a6b8d5e00 /sys/kern/subr_pcpu.c
parent6d7755ffed75007fcc52c6aa8ee3347a280b4706 (diff)
downloadFreeBSD-src-9c75ede409d60f494cbb4b5c953e103ca672a0df.zip
FreeBSD-src-9c75ede409d60f494cbb4b5c953e103ca672a0df.tar.gz
Initial checkin for rmlock (read mostly lock) a multi reader single writer
lock optimized for almost exclusive reader access. (see also rmlock.9) TODO: Convert to per cpu variables linkerset as soon as it is available. Optimize UP (single processor) case.
Diffstat (limited to 'sys/kern/subr_pcpu.c')
-rw-r--r--sys/kern/subr_pcpu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c
index bf9b0c7..1109b31 100644
--- a/sys/kern/subr_pcpu.c
+++ b/sys/kern/subr_pcpu.c
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <ddb/ddb.h>
-static struct pcpu *cpuid_to_pcpu[MAXCPU];
+struct pcpu *cpuid_to_pcpu[MAXCPU];
struct cpuhead cpuhead = SLIST_HEAD_INITIALIZER(cpuhead);
/*
@@ -74,6 +74,9 @@ pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
cpuid_to_pcpu[cpuid] = pcpu;
SLIST_INSERT_HEAD(&cpuhead, pcpu, pc_allcpu);
cpu_pcpu_init(pcpu, cpuid, size);
+ pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue;
+ pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue;
+
}
/*
OpenPOWER on IntegriCloud