[PATCH] ppc64: use smp_mb and smp_wmb

Use smp_mb and smp_wmb. In particular smp_wmb is lighter weight than wmb.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Anton Blanchard 2005-05-01 08:58:47 -07:00 коммит произвёл Linus Torvalds
Родитель eeb24de431
Коммит 0d8d4d42f2
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -125,7 +125,7 @@ void __devinit smp_generic_kick_cpu(int nr)
* the processor will continue on to secondary_start * the processor will continue on to secondary_start
*/ */
paca[nr].cpu_start = 1; paca[nr].cpu_start = 1;
mb(); smp_mb();
} }
#endif /* CONFIG_PPC_MULTIPLATFORM */ #endif /* CONFIG_PPC_MULTIPLATFORM */
@ -256,7 +256,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
} }
call_data = &data; call_data = &data;
wmb(); smp_wmb();
/* Send a message to all other CPUs and wait for them to respond */ /* Send a message to all other CPUs and wait for them to respond */
smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION); smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION);
@ -431,7 +431,7 @@ int generic_cpu_enable(unsigned int cpu)
/* get the target out of it's holding state */ /* get the target out of it's holding state */
per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
wmb(); smp_wmb();
while (!cpu_online(cpu)) while (!cpu_online(cpu))
cpu_relax(); cpu_relax();
@ -447,7 +447,7 @@ void generic_cpu_die(unsigned int cpu)
int i; int i;
for (i = 0; i < 100; i++) { for (i = 0; i < 100; i++) {
rmb(); smp_rmb();
if (per_cpu(cpu_state, cpu) == CPU_DEAD) if (per_cpu(cpu_state, cpu) == CPU_DEAD)
return; return;
msleep(100); msleep(100);
@ -463,7 +463,7 @@ void generic_mach_cpu_die(void)
cpu = smp_processor_id(); cpu = smp_processor_id();
printk(KERN_DEBUG "CPU%d offline\n", cpu); printk(KERN_DEBUG "CPU%d offline\n", cpu);
__get_cpu_var(cpu_state) = CPU_DEAD; __get_cpu_var(cpu_state) = CPU_DEAD;
wmb(); smp_wmb();
while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE) while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
cpu_relax(); cpu_relax();
@ -515,7 +515,7 @@ int __devinit __cpu_up(unsigned int cpu)
* be written out to main store before we release * be written out to main store before we release
* the processor. * the processor.
*/ */
mb(); smp_mb();
/* wake up cpus */ /* wake up cpus */
DBG("smp: kicking cpu %d\n", cpu); DBG("smp: kicking cpu %d\n", cpu);

Просмотреть файл

@ -221,15 +221,15 @@ static __inline__ void timer_recalc_offset(unsigned long cur_tb)
temp_varp->tb_to_xs = do_gtod.varp->tb_to_xs; temp_varp->tb_to_xs = do_gtod.varp->tb_to_xs;
temp_varp->tb_orig_stamp = new_tb_orig_stamp; temp_varp->tb_orig_stamp = new_tb_orig_stamp;
temp_varp->stamp_xsec = new_stamp_xsec; temp_varp->stamp_xsec = new_stamp_xsec;
mb(); smp_mb();
do_gtod.varp = temp_varp; do_gtod.varp = temp_varp;
do_gtod.var_idx = temp_idx; do_gtod.var_idx = temp_idx;
++(systemcfg->tb_update_count); ++(systemcfg->tb_update_count);
wmb(); smp_wmb();
systemcfg->tb_orig_stamp = new_tb_orig_stamp; systemcfg->tb_orig_stamp = new_tb_orig_stamp;
systemcfg->stamp_xsec = new_stamp_xsec; systemcfg->stamp_xsec = new_stamp_xsec;
wmb(); smp_wmb();
++(systemcfg->tb_update_count); ++(systemcfg->tb_update_count);
} }
@ -648,7 +648,7 @@ void ppc_adjtimex(void)
temp_varp->tb_to_xs = new_tb_to_xs; temp_varp->tb_to_xs = new_tb_to_xs;
temp_varp->stamp_xsec = new_stamp_xsec; temp_varp->stamp_xsec = new_stamp_xsec;
temp_varp->tb_orig_stamp = do_gtod.varp->tb_orig_stamp; temp_varp->tb_orig_stamp = do_gtod.varp->tb_orig_stamp;
mb(); smp_mb();
do_gtod.varp = temp_varp; do_gtod.varp = temp_varp;
do_gtod.var_idx = temp_idx; do_gtod.var_idx = temp_idx;
@ -662,10 +662,10 @@ void ppc_adjtimex(void)
* loops back and reads them again until this criteria is met. * loops back and reads them again until this criteria is met.
*/ */
++(systemcfg->tb_update_count); ++(systemcfg->tb_update_count);
wmb(); smp_wmb();
systemcfg->tb_to_xs = new_tb_to_xs; systemcfg->tb_to_xs = new_tb_to_xs;
systemcfg->stamp_xsec = new_stamp_xsec; systemcfg->stamp_xsec = new_stamp_xsec;
wmb(); smp_wmb();
++(systemcfg->tb_update_count); ++(systemcfg->tb_update_count);
write_sequnlock_irqrestore( &xtime_lock, flags ); write_sequnlock_irqrestore( &xtime_lock, flags );