seqlock: Remove memory barrier if Non-SMP.

This commit removed unnecessary memory barriers of the seqlock
implementation, since they may block the CPU pipeline and lead to
performance degradation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
ouyangxiangzhen
2025-09-10 09:36:41 +08:00
committed by Alan C. Assis
parent f1ef43c72e
commit dbc6bedff9
+6
View File
@@ -104,7 +104,10 @@ unsigned int read_seqbegin(FAR const seqcount_t *s)
while ((seq = s->sequence) & 1);
#ifdef CONFIG_SMP
UP_DMB();
#endif
return seq;
}
@@ -129,7 +132,10 @@ unsigned int read_seqretry(FAR const seqcount_t *s, unsigned int start)
{
unsigned int seq;
#ifdef CONFIG_SMP
UP_DMB();
#endif
seq = s->sequence;
return seq != start;
}