linux-btrace.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-btrace@vger.kernel.org
Subject: Re: [PATCH] signal condition variable at end of stop_tracers
Date: Mon, 08 Sep 2014 14:16:10 +0000	[thread overview]
Message-ID: <540DBA2A.8000007@kernel.dk> (raw)
In-Reply-To: <20140908073852.GA19062@ulegcprs1.emea.nsn-net.net>

On 09/08/2014 01:38 AM, Robert Schiele wrote:
> stop_tracers modifies tp->is_done and thus must signal the condition
> variable tracer_wait_unblock is waiting on to monitor tp->is_done.
> Not doing so might cause the tool to deadlock if stop_tracers is
> called while a tracer thread is in tracer_wait_unblock.
> 
> Signed-off-by: Robert Schiele <rschiele@gmail.com>
> ---
>  blktrace.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/blktrace.c b/blktrace.c
> index 7e64c94..3c8fb4c 100644
> --- a/blktrace.c
> +++ b/blktrace.c
> @@ -1913,6 +1913,7 @@ static void stop_tracers(void)
>  		struct tracer *tp = list_entry(p, struct tracer, head);
>  		tp->is_done = 1;
>  	}
> +	pthread_cond_broadcast(&mt_cond);
>  }
>  
>  static void del_tracers(void)
> 

Good catch! Applied.

-- 
Jens Axboe


      reply	other threads:[~2014-09-08 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08  7:38 [PATCH] signal condition variable at end of stop_tracers Robert Schiele
2014-09-08 14:16 ` Jens Axboe [this message]

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=540DBA2A.8000007@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-btrace@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).