Re: ptracee data structures cleanup

2009-04-21 Thread Oleg Nesterov
On 04/20, Roland McGrath wrote: Afaics ptrace_attach() needs this lock only to pin -mm, no other other reasons. ptrace_traceme() doesn't need it at all. I'm pretty sure that -mm check is only meant to exclude kernel threads. It should check PF_KTHREAD now, Yes. But

Re: ptracee data structures cleanup

2009-04-20 Thread Oleg Nesterov
On 04/16, Roland McGrath wrote: But even that is a lot of hair for the incremental patches in the first several stages, I think. So just never deallocate it, and: static inline int task_ptrace(struct task_struct *task) { return unlikely(task-ptrace_child) ?

Re: ptracee data structures cleanup

2009-04-16 Thread Roland McGrath
So. We are going to make a separate, dynamically allocated structure for tracees. Say, we add struct ptrace_child *ptrace_child into task_struct. Right. attach/attachme do kmalloc() and use task_lock() to avoid races. (with the current locking write_lock(tasklist) alone is enough). Sure.