Re: [PATCH 2/7] pid: Add do_each_pid_task

From: Oleg Nesterov
Date: Wed Aug 16 2006 - 10:51:34 EST


On 08/15, Eric W. Biederman wrote:
>
> +#define do_each_pid_task(pid, type, task) \
> + if ((task = pid_task(pid, type))) { \
> + prefetch(pid_next(task, type)); \
> + do {
> +
> +#define while_each_pid_task(pid, type, task) \
> + } while (pid_next(task, type) && ({ \
> + task = pid_next_task(task, type); \
> + rcu_dereference(task); \
> + prefetch(pid_next(task, type)); \
> + 1; }) ); \
> + }

A small nit. Suppose a non-leader thread blocks a signal, and does
exec. There is a window when we have 2 tasks with the same pid in
PIDTYPE_PID namespace. If send_sigio() send the signal in that
window, it will be delivered twice to process.

Oleg.

-
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/