* [PATCH 2/2] uglify while_each_pid_task() to make sure we don't count the execing pricess twice
@ 2007-12-07 17:03 Oleg Nesterov
0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2007-12-07 17:03 UTC (permalink / raw)
To: Andrew Morton
Cc: Eric W. Biederman, Davide Libenzi, Pavel Emelyanov,
Roland McGrath, linux-kernel
There is a window when de_thread() switches the leader and drops tasklist_lock.
In that window do_each_pid_task(PIDTYPE_PID) finds both new and old leaders.
The problem is pretty much theoretical and probably can be ignored. Currently
the only users of do_each_pid_task(PIDTYPE_PID) are send_sigio/send_sigurg, so
they can send the signal to the same process twice.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- PT/include/linux/pid.h~2_do_each_pid_task 2007-10-25 16:22:12.000000000 +0400
+++ PT/include/linux/pid.h 2007-12-07 18:24:21.000000000 +0300
@@ -160,7 +160,13 @@ static inline pid_t pid_vnr(struct pid *
hlist_for_each_entry_rcu((task), pos___, \
&pid->tasks[type], pids[type].node) {
+ /*
+ * Both old and new leaders may be attached to
+ * the same pid in the middle of de_thread().
+ */
#define while_each_pid_task(pid, type, task) \
+ if (type == PIDTYPE_PID) \
+ break; \
} \
} while (0)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-07 17:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-07 17:03 [PATCH 2/2] uglify while_each_pid_task() to make sure we don't count the execing pricess twice Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®