signal: zap_pid_ns_processes: s/SEND_SIG_NOINFO/SEND_SIG_FORCED/

Change zap_pid_ns_processes() to use SEND_SIG_FORCED, it looks more
clear compared to SEND_SIG_NOINFO which relies on from_ancestor_ns logic
send_signal().

It is also more efficient if we need to kill a lot of tasks because it
doesn't alloc sigqueue.

While at it, add the __fatal_signal_pending(task) check as a minor
optimization.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Oleg Nesterov 2012-03-23 15:02:46 -07:00 коммит произвёл Linus Torvalds
Родитель d2d393099d
Коммит a02d6fd643
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -168,13 +168,9 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
while (nr > 0) { while (nr > 0) {
rcu_read_lock(); rcu_read_lock();
/*
* Any nested-container's init processes won't ignore the
* SEND_SIG_NOINFO signal, see send_signal()->si_fromuser().
*/
task = pid_task(find_vpid(nr), PIDTYPE_PID); task = pid_task(find_vpid(nr), PIDTYPE_PID);
if (task) if (task && !__fatal_signal_pending(task))
send_sig_info(SIGKILL, SEND_SIG_NOINFO, task); send_sig_info(SIGKILL, SEND_SIG_FORCED, task);
rcu_read_unlock(); rcu_read_unlock();