public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: David Smith <dsmith@redhat.com>,
	Torsten Polle <Torsten.Polle@gmx.de>,
	       systemtap@sourceware.org
Subject: Re: [PATCH] stap/staprun do not terminate properly
Date: Mon, 10 Mar 2014 22:36:00 -0000	[thread overview]
Message-ID: <531E3E77.30701@redhat.com> (raw)
In-Reply-To: <531A3581.7050009@redhat.com>

On 03/07/2014 01:09 PM, David Smith wrote:
> So, instead I did this:
> 
> ====
> stap_stap_task_finder()
> {
>   // ...
> 
>   __stp_tf_cancel_task_work();
> 
>   // Note that utrace_exit() calls stp_task_work_exit()
>   utrace_exit();
> }
> ====
> 
> This moves canceling all outstanding task_work items before shutting
> down utrace (and calling stp_task_work_exit()). I think the end result
> is the same as your patch, and I think this makes a little more sense.
> This way we've canceled all the task_work items before shutting down
> utrace (and freeing all the memory allocated for utrace).
> 
> If this doesn't work for you or you see a hole in this logic please let
> me know.

I notice that utrace_exit() calls utrace_shutdown(), but so does
__stp_task_finder_cleanup() earlier in stap_stop_task_finder().  So in
fact the shutdown is still happening before canceling this work, and the
only thing left for utrace_exit() is the kmem_cache_destroy and
stp_task_work_exit().  Do you think this could be a problem?

In particular, I worry about this comment:

  /* After calling tracepoint_synchronize_unregister(), we're
   * sure there are no outstanding tracepoint probes being
   * called.  So, now would be a great time to free everything. */

There won't be any outstanding tracepoint handlers, but couldn't there
still be outstanding task_work scheduled from those handlers?

  parent reply	other threads:[~2014-03-10 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 21:30 Torsten Polle
2014-03-07 21:09 ` David Smith
2014-03-07 22:11   ` Torsten Polle
2014-03-10 22:36   ` Josh Stone [this message]
2014-03-12 14:11     ` David Smith

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=531E3E77.30701@redhat.com \
    --to=jistone@redhat.com \
    --cc=Torsten.Polle@gmx.de \
    --cc=dsmith@redhat.com \
    --cc=systemtap@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).