projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
qsbr: micro optimization of the gp use.
[urcu.git]
/
urcu-qsbr-static.h
diff --git
a/urcu-qsbr-static.h
b/urcu-qsbr-static.h
index 86ae7d4aca91a6dd0ac998e5bf425b054a152716..8d8aa3f8f60519620dbcfb78aef1b007c6183e5c 100644
(file)
--- a/
urcu-qsbr-static.h
+++ b/
urcu-qsbr-static.h
@@
-171,10
+171,12
@@
extern long __thread rcu_reader_qs_gp;
static inline int rcu_gp_ongoing(long *value)
{
static inline int rcu_gp_ongoing(long *value)
{
+ long reader_gp;
+
if (value == NULL)
return 0;
if (value == NULL)
return 0;
-
- return
LOAD_SHARED(*value) & 1
;
+ reader_gp = LOAD_SHARED(*value);
+ return
reader_gp && (reader_gp - urcu_gp_ctr < 0)
;
}
static inline void _rcu_read_lock(void)
}
static inline void _rcu_read_lock(void)
@@
-189,19
+191,19
@@
static inline void _rcu_read_unlock(void)
static inline void _rcu_quiescent_state(void)
{
smp_mb();
static inline void _rcu_quiescent_state(void)
{
smp_mb();
-
rcu_reader_qs_gp = ACCESS_ONCE(urcu_gp_ctr) + 1
;
+
_STORE_SHARED(rcu_reader_qs_gp, _LOAD_SHARED(urcu_gp_ctr))
;
smp_mb();
}
static inline void _rcu_thread_offline(void)
{
smp_mb();
smp_mb();
}
static inline void _rcu_thread_offline(void)
{
smp_mb();
-
rcu_reader_qs_gp = 0
;
+
STORE_SHARED(rcu_reader_qs_gp, 0)
;
}
static inline void _rcu_thread_online(void)
{
}
static inline void _rcu_thread_online(void)
{
-
rcu_reader_qs_gp = ACCESS_ONCE(urcu_gp_ctr) + 1
;
+
_STORE_SHARED(rcu_reader_qs_gp, LOAD_SHARED(urcu_gp_ctr))
;
smp_mb();
}
smp_mb();
}
This page took
0.02417 seconds
and
4
git commands to generate.