Messages in this thread |  | | | Date | Sun, 23 Nov 2008 17:44:22 +0100 | | From | Ingo Molnar <> | | Subject | Re: [PATCH] tracing/function-return-tracer: don't trace kfree while it frees the return stack |
| |
* 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
|  |