Skip to contentSkip to conversation

Fix: increment channel refcount on add_stream

PATCH Mathieu Desnoyers 2 participants 3 messages May 23, 2013 – Jul 8, 2013 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · * Julien Desfossez ([email protected]) wrote:

check the impact on the ust side ?

Quoted 26 lines
---
 src/common/consumer.c |    3 +++
 1 file changed, 3 insertions(+)
src/common/consumer.c +3 -0
index c9e4bae..bfb809a 100644
@@ -663,6 +663,9 @@ static int add_stream(struct lttng_consumer_stream *stream,
 		uatomic_inc(&relayd->refcount);
 	}
 
+	/* Update channel refcount once added without error(s). */
+	uatomic_inc(&stream->chan->refcount);
+
 	/*
 	 * When nb_init_stream_left reaches 0, we don't need to trigger any action
 	 * in terms of destroying the associated channel, because the action that
Signature · 7 lines
1.7.10.4


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

A message that is not in the archive (sent off-list or not yet received): 20130523220716.GB16552@Krystal

#3 lore raw

We can't merge that for UST. However, it needs to be done on the kernel side! Removing it from the add_stream did impact the kernel. This is a good fine but should not be done there.

See commit: b31398bb2b3fa91a53dea3b36fd693da4b50e0d3

David

Mathieu Desnoyers:

Quoted 32 lines · * Julien Desfossez ([email protected]) wrote:
Quoted 1 line

check the impact on the ust side ?

Quoted 26 lines
---
 src/common/consumer.c |    3 +++
 1 file changed, 3 insertions(+)
src/common/consumer.c +3 -0
index c9e4bae..bfb809a 100644
@@ -663,6 +663,9 @@ static int add_stream(struct lttng_consumer_stream *stream,
 		uatomic_inc(&relayd->refcount);
 	}
 
+	/* Update channel refcount once added without error(s). */
+	uatomic_inc(&stream->chan->refcount);
+
 	/*
 	 * When nb_init_stream_left reaches 0, we don't need to trigger any action
 	 * in terms of destroying the associated channel, because the action that
Signature · 7 lines
1.7.10.4


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#4 lore raw
In reply to a message not in the archive
Quoted 1 line · * Julien Desfossez ([email protected]) wrote:

This patch was merged into master and stable-2.2 of lttng-tools.

Quoted 26 lines
---
 src/common/consumer.c |    3 +++
 1 file changed, 3 insertions(+)
src/common/consumer.c +3 -0
index c9e4bae..bfb809a 100644
@@ -663,6 +663,9 @@ static int add_stream(struct lttng_consumer_stream *stream,
 		uatomic_inc(&relayd->refcount);
 	}
 
+	/* Update channel refcount once added without error(s). */
+	uatomic_inc(&stream->chan->refcount);
+
 	/*
 	 * When nb_init_stream_left reaches 0, we don't need to trigger any action
 	 * in terms of destroying the associated channel, because the action that
Signature · 7 lines
1.7.10.4


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com