lkml.org 
[lkml]   [2012]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] fs, proc: Introduce /proc/<pid>/task/<tid>/children entry v6
    On 01/16, Cyrill Gorcunov wrote:
    >
    > +get_children_pid(struct proc_pid_children_iter *iter, struct pid *pid_prev, loff_t pos)
    > +{
    > + struct task_struct *start, *task;
    > + struct pid *pid = NULL;
    > +
    > + read_lock(&tasklist_lock);
    > +
    > + start = pid_task(iter->pid_start, PIDTYPE_PID);
    > + if (!start)
    > + goto out;
    > +
    > + /*
    > + * Lets try to continue searching first, this gives
    > + * us significant speedup on children-rich processes.
    > + */
    > + if (pid_prev) {
    > + task = pid_task(pid_prev, PIDTYPE_PID);
    > + if (task && task->real_parent == start &&
    > + !(list_empty(&task->sibling))) {

    Damn. No, this is wrong.

    Damn! Yes, it was we who told you to check list_empty(sibling) ;)

    But this is not enough. exit_ptrace() can do list_move() without
    changing ->real_parent.

    I'll try to think. At first glance we can rely on EXIT_DEAD, but
    I'd like to avoid this, I think EXIT_DEAD should die.

    Oleg.



    \
     
     \ /
      Last update: 2012-01-16 17:19    [W:0.022 / U:59.200 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site