netisr: Make netisr barrier's done and cpumask volatile
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 25 Jan 2011 05:35:11 +0000 (13:35 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 31 Jan 2011 01:46:12 +0000 (09:46 +0800)
So that the assignment to these two variables and the following wakeup()
will not get reordered.

sys/net/netisr.c

index caf3234..648b8c9 100644 (file)
@@ -73,8 +73,8 @@ struct netmsg_rollup {
 
 struct netmsg_barrier {
        struct netmsg_base      base;
-       cpumask_t               *br_cpumask;
-       int                     br_done;
+       volatile cpumask_t      *br_cpumask;
+       volatile int            br_done;
 };
 
 struct netisr_barrier {
@@ -583,7 +583,7 @@ void
 netisr_barrier_set(struct netisr_barrier *br)
 {
 #ifdef SMP
-       cpumask_t other_cpumask;
+       volatile cpumask_t other_cpumask;
        int i, cur_cpuid;
 
        KKASSERT(&curthread->td_msgport == cpu_portfn(0));