test: test for the proper pointer
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/4 test: remove rcu_defer_register_thread() from test_urcu_lfs
test_urcu_lfs has already switch to call_rcu(), rcu_defer_register_thread() is unneeded.
--- tests/test_urcu_lfs.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
tests/test_urcu_lfs.c +0 -8
@@ -67,7 +67,6 @@ static inline pid_t gettid(void)#endif #include <urcu.h> #include <urcu/cds.h> -#include <urcu-defer.h> static volatile int test_go, test_stop;
@@ -221,18 +220,12 @@ void free_node_cb(struct rcu_head *head)void *thr_dequeuer (void *_count) {unsigned long long *count = _count; -int ret;printf_verbose ("thread_begin %s, thread id : %lx, tid %lu\n" ,"dequeuer" ,pthread_self (), (unsigned long )gettid ());set_affinity (); - ret =rcu_defer_register_thread (); -if (ret) { -printf ("Error in rcu_defer_register_thread\n" ); -exit (-1 ); - }rcu_register_thread ();while (!test_go)
@@ -261,7 +254,6 @@ void *thr_dequeuer(void *_count) }rcu_unregister_thread (); -rcu_defer_unregister_thread (); printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n",
Signature · 1 line
1.7.7.6
PATCH 3/4 test: test for the proper pointer
In reply to a message not in the archiveWe should use "if (qnode)" instead of "if (node)" in case of the struct cds_lfq_node_rcu is not the first field of struct node.
--- tests/test_urcu_lfq.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
tests/test_urcu_lfq.c +4 -3
@@ -243,14 +243,15 @@ void *thr_dequeuer(void *_count)for (;;) {struct cds_lfq_node_rcu *qnode; -struct test *node;rcu_read_lock (); qnode =cds_lfq_dequeue_rcu (&q); - node = caa_container_of(qnode, struct test, list);rcu_read_unlock (); -if (node) { +if (qnode) { +struct test *node; + + node = caa_container_of(qnode, struct test, list);call_rcu (&node->rcu, free_node_cb);URCU_TLS (nr_successful_dequeues)++; }
Signature · 1 line
1.7.7.6
PATCH 4/4 test: remove rcu_defer_register_thread() from test_urcu_lfq
In reply to a message not in the archivetest_urcu_lfq has already switch to call_rcu(), rcu_defer_register_thread() is unneeded.
--- tests/test_urcu_lfq.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
tests/test_urcu_lfq.c +0 -8
@@ -67,7 +67,6 @@ static inline pid_t gettid(void)#endif #include <urcu.h> #include <urcu/cds.h> -#include <urcu-defer.h> static volatile int test_go, test_stop;
@@ -222,18 +221,12 @@ void free_node_cb(struct rcu_head *head)void *thr_dequeuer (void *_count) {unsigned long long *count = _count; -int ret;printf_verbose ("thread_begin %s, thread id : %lx, tid %lu\n" ,"dequeuer" ,pthread_self (), (unsigned long )gettid ());set_affinity (); - ret =rcu_defer_register_thread (); -if (ret) { -printf ("Error in rcu_defer_register_thread\n" ); -exit (-1 ); - }rcu_register_thread ();while (!test_go)
@@ -264,7 +257,6 @@ void *thr_dequeuer(void *_count) }rcu_unregister_thread (); -rcu_defer_unregister_thread (); printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n", pthread_self(), (unsigned long)gettid(),
Signature · 1 line
1.7.7.6
Mathieu Desnoyers
AppliedQuoted 4 lines · * Lai Jiangshan ([email protected]) wrote:
We should use "if (snode)" instead of "if (node)" in case of the struct
cds_lfs_node_rcuis not the first field of struct node.Signed-off-by Lai Jiangshan <[email protected]>
merged, thanks!
Mathieu
Quoted 29 lines
--- tests/test_urcu_lfs.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)tests/test_urcu_lfs.c +4
-3@@ -242,13 +242,14 @@ void *thr_dequeuer(void *_count)for (;;) {struct cds_lfs_node_rcu *snode; -struct test *node;rcu_read_lock (); snode =cds_lfs_pop_rcu (&s); - node = caa_container_of(snode, struct test, list);rcu_read_unlock (); -if (node) { +if (snode) { +struct test *node; + + node = caa_container_of(snode, struct test, list);call_rcu (&node->rcu, free_node_cb);URCU_TLS (nr_successful_dequeues)++; }Signature · 1 line
1.7.7.6
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
AppliedRe: [PATCH 2/4] test: remove rcu_defer_register_thread() from test_urcu_lfs
Quoted 2 lines · * Lai Jiangshan ([email protected]) wrote:
test_urcu_lfshas already switch tocall_rcu(),rcu_defer_register_thread()is unneeded.
Merged, thanks!
Mathieu
Quoted 48 lines
Signed-off-by Lai Jiangshan <[email protected]>--- tests/test_urcu_lfs.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)tests/test_urcu_lfs.c +0
-8@@ -67,7 +67,6 @@ static inline pid_t gettid(void)#endif #include <urcu.h> #include <urcu/cds.h> -#include <urcu-defer.h> static volatile int test_go, test_stop;@@ -221,18 +220,12 @@ void free_node_cb(struct rcu_head *head)void *thr_dequeuer (void *_count) {unsigned long long *count = _count; -int ret;printf_verbose ("thread_begin %s, thread id : %lx, tid %lu\n" ,"dequeuer" ,pthread_self (), (unsigned long )gettid ());set_affinity (); - ret =rcu_defer_register_thread (); -if (ret) { -printf ("Error in rcu_defer_register_thread\n" ); -exit (-1 ); - }rcu_register_thread ();while (!test_go)@@ -261,7 +254,6 @@ void *thr_dequeuer(void *_count) }rcu_unregister_thread (); -rcu_defer_unregister_thread (); printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n",Signature · 1 line
1.7.7.6
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
AppliedQuoted 2 lines · * Lai Jiangshan ([email protected]) wrote:
We should use "if (qnode)" instead of "if (node)" in case of the struct
cds_lfq_node_rcuis not the first field of struct node.
merged, thanks!
Mathieu
Quoted 32 lines
Signed-off-by Lai Jiangshan <[email protected]>--- tests/test_urcu_lfq.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)tests/test_urcu_lfq.c +4
-3@@ -243,14 +243,15 @@ void *thr_dequeuer(void *_count)for (;;) {struct cds_lfq_node_rcu *qnode; -struct test *node;rcu_read_lock (); qnode =cds_lfq_dequeue_rcu (&q); - node = caa_container_of(qnode, struct test, list);rcu_read_unlock (); -if (node) { +if (qnode) { +struct test *node; + + node = caa_container_of(qnode, struct test, list);call_rcu (&node->rcu, free_node_cb);URCU_TLS (nr_successful_dequeues)++; }Signature · 1 line
1.7.7.6
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
AppliedRe: [PATCH 4/4] test: remove rcu_defer_register_thread() from test_urcu_lfq
Quoted 2 lines · * Lai Jiangshan ([email protected]) wrote:
test_urcu_lfqhas already switch tocall_rcu(),rcu_defer_register_thread()is unneeded.
merged, thanks!
Mathieu
Quoted 48 lines
Signed-off-by Lai Jiangshan <[email protected]>--- tests/test_urcu_lfq.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)tests/test_urcu_lfq.c +0
-8@@ -67,7 +67,6 @@ static inline pid_t gettid(void)#endif #include <urcu.h> #include <urcu/cds.h> -#include <urcu-defer.h> static volatile int test_go, test_stop;@@ -222,18 +221,12 @@ void free_node_cb(struct rcu_head *head)void *thr_dequeuer (void *_count) {unsigned long long *count = _count; -int ret;printf_verbose ("thread_begin %s, thread id : %lx, tid %lu\n" ,"dequeuer" ,pthread_self (), (unsigned long )gettid ());set_affinity (); - ret =rcu_defer_register_thread (); -if (ret) { -printf ("Error in rcu_defer_register_thread\n" ); -exit (-1 ); - }rcu_register_thread ();while (!test_go)@@ -264,7 +257,6 @@ void *thr_dequeuer(void *_count) }rcu_unregister_thread (); -rcu_defer_unregister_thread (); printf_verbose("dequeuer thread_end, thread id : %lx, tid %lu, " "dequeues %llu, successful_dequeues %llu\n", pthread_self(), (unsigned long)gettid(),Signature · 1 line
1.7.7.6
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com