summaryrefslogtreecommitdiffstats
path: root/sys/sys/pcpu.h
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/sys/pcpu.h
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/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index b2fd628..8757fe6 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -48,6 +48,15 @@
struct pcb;
struct thread;
+/*
+ * XXXUPS remove as soon as we have per cpu variable
+ * linker sets and can define rm_queue in _rm_lock.h
+*/
+struct rm_queue {
+ struct rm_queue* volatile rmq_next;
+ struct rm_queue* volatile rmq_prev;
+};
+
/*
* This structure maps out the global data that needs to be kept on a
* per-cpu basis. The members are accessed via the PCPU_GET/SET/PTR
@@ -74,6 +83,15 @@ struct pcpu {
PCPU_MD_FIELDS;
struct vmmeter pc_cnt; /* VM stats counters */
struct device *pc_device;
+
+ /*
+ * Stuff for read mostly lock
+ *
+ * XXXUPS remove as soon as we have per cpu variable
+ * linker sets.
+ */
+ struct rm_queue pc_rm_queue;
+
};
SLIST_HEAD(cpuhead, pcpu);
@@ -92,6 +110,10 @@ extern struct cpuhead cpuhead;
* db_show_mdpcpu() is responsible for handling machine dependent
* fields for the DDB 'show pcpu' command.
*/
+
+extern struct pcpu *cpuid_to_pcpu[MAXCPU];
+
+
void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size);
void db_show_mdpcpu(struct pcpu *pcpu);
OpenPOWER on IntegriCloud