Messages in this thread | | | From | (Eric W. Biederman) | Date | Tue, 03 Feb 2009 13:39:44 -0800 | Subject | Re: [PATCH] ftrace: do_each_pid_task() needs rcu lock |
| |
Oleg Nesterov <oleg@redhat.com> writes:
> On 02/03, Oleg Nesterov wrote: >> >> "ftrace: use struct pid" commit 978f3a45d9499c7a447ca7615455cefb63d44165 >> converted ftrace_pid_trace to "struct pid*". But we can't use >> do_each_pid_task() without rcu_read_lock() even if we know the pid >> itself can't go away (it was pinned in ftrace_pid_write). The exiting >> task can detach itself from this pid at any moment. > > Q: why do we use do_each_pid_task(PIDTYPE_PID) ? We can never have more > than 1 task in the loop. Perhaps,
That is a bug in do_each_pid_task(PIDTYPE_PID). For ftrace we really want to grab all tasks with a given pid even in the crazy exec case.
Eric
| |