aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hpet.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-06-18 14:09:44 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-06-18 14:09:44 +0100
commit636fed5063dc8a5d0c64bb15bfa13616304415bd (patch)
tree22b13824d70de9a1d6c35080b4ec685086fe802e /xen/arch/x86/hpet.c
parentd3e1e67d8ad428d79e0f0bba5b52f390ad70ec6c (diff)
downloadxen-636fed5063dc8a5d0c64bb15bfa13616304415bd.tar.gz
xen-636fed5063dc8a5d0c64bb15bfa13616304415bd.tar.bz2
xen-636fed5063dc8a5d0c64bb15bfa13616304415bd.zip
cpuidle: add comments for hpet cpumask_lock usage
Signed-off-by: Wei Gang <gang.wei@intel.com>
Diffstat (limited to 'xen/arch/x86/hpet.c')
-rw-r--r--xen/arch/x86/hpet.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 25e4434cc1..4d9d5a1b61 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -34,6 +34,17 @@ struct hpet_event_channel
int shift;
s_time_t next_event;
cpumask_t cpumask;
+ /*
+ * cpumask_lock is used to prevent hpet intr handler from accessing other
+ * cpu's timer_deadline_start/end after the other cpu's mask was cleared --
+ * mask cleared means cpu waken up, then accessing timer_deadline_xxx from
+ * other cpu is not safe.
+ * It is not used for protecting cpumask, so set ops needn't take it.
+ * Multiple cpus clear cpumask simultaneously is ok due to the atomic
+ * feature of cpu_clear, so hpet_broadcast_exit() can take read lock for
+ * clearing cpumask, and handle_hpet_broadcast() have to take write lock
+ * for read cpumask & access timer_deadline_xxx.
+ */
rwlock_t cpumask_lock;
spinlock_t lock;
void (*event_handler)(struct hpet_event_channel *);