Re: [RFC] ps command race fix

From: KAMEZAWA Hiroyuki
Date: Mon Jul 24 2006 - 22:30:03 EST


On Mon, 24 Jul 2006 19:06:26 -0700
Andrew Morton <akpm@xxxxxxxx> wrote:
> > but it was not very good because
> > proc_pid_readdir() has to traverse all pids, not tgids.
>
> You mean "all tgids, not pids".
>
Ah, sorry. Precisely, traverse all pids and choose tgids from them because
pid_hash[] remembers all pids.


> > So, I had to access
> > task_struct of the pid. I wanted to avoid to access task struct itself,
>
> Why do you wish to avoid accessing the task_struct?
>
I thought accessing all task struct at random is heavy work and have to
up and down rcu_read_lock thousands of times.
I'm sorry if my thought is not problem.

Thanks,
-Kame

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/