All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing/function-return-tracer: don't trace kfree while it frees the return stack
Date: Sun, 23 Nov 2008 17:44:22 +0100	[thread overview]
Message-ID: <20081123164422.GA10029@elte.hu> (raw)
In-Reply-To: <20081123164013.GC6206@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

>  void ftrace_retfunc_exit_task(struct task_struct *t)
>  {
> -	kfree(t->ret_stack);
> +	struct ftrace_ret_stack	*ret_stack = t->ret_stack;
> +
>  	t->ret_stack = NULL;
> +	/* NULL must become visible to IRQs before we free it: */
> +	barrier();
> +
> +	kfree(ret_stack);
>  }

hm, this reminds me - this is the wrong place for the callback - the 
call stack is freed too early.

instead of freeing it in do_exit() (like it's done right now), it 
should be freed when the task struct and thread info is freed: in 
kernel/fork.c:free_task() - okay?

The difference is minor but could allow more complete tracing: as 
right now we'll skip the entries that get generated when we schedule 
away from a dead task.

	Ingo

  reply	other threads:[~2008-11-23 16:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-23 16:33 [PATCH] tracing/function-return-tracer: don't trace kfree while it frees the return stack Frederic Weisbecker
2008-11-23 16:40 ` Ingo Molnar
2008-11-23 16:44   ` Ingo Molnar [this message]
2008-11-23 17:43     ` Frederic Weisbecker
2008-11-23 19:24   ` Steven Rostedt
2008-11-23 19:35     ` Ingo Molnar
2008-11-23 19:48       ` Steven Rostedt

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=20081123164422.GA10029@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.