From: dgoulet@efficios.com (David Goulet)
Subject: [lttng-dev] [PATCH lttng-tools 1/3] Fix: Add missing call rcu and read side lock
Date: Wed, 3 Oct 2012 11:48:35 -0400 [thread overview]
Message-ID: <1349279317-28056-1-git-send-email-dgoulet@efficios.com> (raw)
Signed-off-by: David Goulet <dgoulet at efficios.com>
---
src/common/consumer.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/common/consumer.c b/src/common/consumer.c
index f01eb5d..7c3762e 100644
--- a/src/common/consumer.c
+++ b/src/common/consumer.c
@@ -688,7 +688,9 @@ void consumer_del_channel(struct lttng_consumer_channel *channel)
}
}
+ rcu_read_lock();
call_rcu(&channel->node.head, consumer_free_channel);
+ rcu_read_unlock();
end:
pthread_mutex_unlock(&consumer_data.lock);
}
@@ -1535,7 +1537,7 @@ static void destroy_stream_ht(struct lttng_ht *ht)
ret = lttng_ht_del(ht, &iter);
assert(!ret);
- free(stream);
+ call_rcu(&stream->node.head, consumer_free_stream);
}
rcu_read_unlock();
@@ -1635,7 +1637,9 @@ static void consumer_del_metadata_stream(struct lttng_consumer_stream *stream)
consumer_del_channel(stream->chan);
}
- free(stream);
+ rcu_read_lock();
+ call_rcu(&stream->node.head, consumer_free_stream);
+ rcu_read_unlock();
}
/*
--
1.7.10.4
next reply other threads:[~2012-10-03 15:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-03 15:48 David Goulet [this message]
2012-10-03 15:48 ` [lttng-dev] [PATCH lttng-tools 2/3] Add hash table argument to helper functions David Goulet
2012-10-03 16:29 ` Mathieu Desnoyers
2012-10-03 15:48 ` [lttng-dev] [PATCH lttng-tools 3/3] Fix: Stream allocation and insertion consistency David Goulet
2012-10-03 16:38 ` Mathieu Desnoyers
2012-10-03 16:42 ` David Goulet
2012-10-03 16:48 ` David Goulet
2012-10-03 17:06 ` Mathieu Desnoyers
2012-10-03 16:28 ` [lttng-dev] [PATCH lttng-tools 1/3] Fix: Add missing call rcu and read side lock 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=1349279317-28056-1-git-send-email-dgoulet@efficios.com \
--to=dgoulet@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