Messages in this thread |  | | | Date | Wed, 19 Jan 2011 16:37:46 +0100 | | From | Oleg Nesterov <> | | Subject | Re: Q: perf_event && task->ptrace_bps[] |
| |
On 01/18, Frederic Weisbecker wrote: > > On Mon, Jan 17, 2011 at 09:34:59PM +0100, Oleg Nesterov wrote: > > > > Any idea how to fix this cleanly? May be we can reuse perf_event_mutex, > > but this looks soooo ugly. And do_exit()->flush_ptrace_hw_breakpoint() > > has the strange "FIXME:" comment which doesn't help me to understand > > what can we do. > > Yeah forget about the FIXME, it's a stale thing I need to remove.
OK, good.
> > Probably the best fix is to change this code so that the tracer owns > > ->ptrace_bps[], not the tracee. But this is not trivial, and needs a > > lot of changes in ptrace code. > > How much complicated would it be?
The problem is, ptrace_detach/release_task can't sleep currently. The necessary changes are nasty.
> Because I see three solutions to solve this: > > - Have a mutex inside thread->ptrace_bps. The contention must be > rare and only concern ptrace and tracee exit. That's the simplest.
I think we can reuse perf_event_mutex for this. Not very good too, but simple. But this depends on what can we do under this mutex...
I am going to report a couple more bugs (at least, it looks like a bug when I am trying to understand the code ;), probably they should be fixed first.
Oleg.
|  |