Skip to contentSkip to conversation

count_stat_eventual: Remove unnecessary smp_mb()

PATCH New Junchang Wang 1 participant 1 message May 17, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 count_stat_eventual: Remove unnecessary smp_mb()

In function count_cleanup(), there is no need to run smp_mb( ) in between statement writing to and statement reading from the same variable, stopflag. Remove smp_mb().

---
 CodeSamples/count/count_stat_eventual.c | 1 -
 1 file changed, 1 deletion(-)
CodeSamples/count/count_stat_eventual.c +0 -1
index 464de30..0e13fc4 100644
@@ -68,7 +68,6 @@ void count_init(void)
 void count_cleanup(void)
 {
 	WRITE_ONCE(stopflag, 1);
-	smp_mb();
 	while (READ_ONCE(stopflag) < 3)
 		poll(NULL, 0, 1);
 	smp_mb();
Signature · 1 line
2.7.4