mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
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:
committed by
Alan C. Assis
parent
f1ef43c72e
commit
dbc6bedff9
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user