From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [PATCH 3/4] test: test for the proper pointer
Date: Sat, 13 Oct 2012 12:48:58 -0400 [thread overview]
Message-ID: <20121013164858.GG29985@Krystal> (raw)
In-Reply-To: <1350144514-4132-3-git-send-email-laijs@cn.fujitsu.com>
* Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
> We 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.
merged, thanks!
Mathieu
>
> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
> ---
> tests/test_urcu_lfq.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c
> index 66ddd41..0fcbf55 100644
> --- a/tests/test_urcu_lfq.c
> +++ b/tests/test_urcu_lfq.c
> @@ -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)++;
> }
> --
> 1.7.7.6
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2012-10-13 16:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-13 16:08 [lttng-dev] [PATCH 1/4] " Lai Jiangshan
2012-10-13 16:08 ` [lttng-dev] [PATCH 2/4] test: remove rcu_defer_register_thread() from test_urcu_lfs Lai Jiangshan
2012-10-13 16:46 ` Mathieu Desnoyers
2012-10-13 16:08 ` [lttng-dev] [PATCH 3/4] test: test for the proper pointer Lai Jiangshan
2012-10-13 16:48 ` Mathieu Desnoyers [this message]
2012-10-13 16:08 ` [lttng-dev] [PATCH 4/4] test: remove rcu_defer_register_thread() from test_urcu_lfq Lai Jiangshan
2012-10-13 16:49 ` Mathieu Desnoyers
2012-10-13 16:44 ` [lttng-dev] [PATCH 1/4] test: test for the proper pointer Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121013164858.GG29985@Krystal \
--to=mathieu.desnoyers@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox