Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1238243

Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process()

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process()
Date 2015-10-02 15:40 +0200
Message-ID <qf8J7-4MS-85@gated-at.bofh.it> (permalink)
References (1 earlier) <qeOKm-1gw-15@gated-at.bofh.it> <qeQj8-3kO-21@gated-at.bofh.it> <qf6QW-26b-7@gated-at.bofh.it> <qf7tE-351-17@gated-at.bofh.it> <qf7N0-3r7-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 02-10-15 21:33:08, Tetsuo Handa wrote:
> Michal Hocko wrote:
> > > Since T sends SIGKILL to all clone(CLONE_VM) tasks upon coredump, P needs
> > > to do
> > 
> > It does that only to all threads in the _same_ thread group AFAIU.
> 
> I'm confused. What the _same_ thread group?
> 
> I can observe that SIGKILL is sent to all
> 
>   clone(CLONE_THREAD | CLONE_SIGHAND | CLONE_VM)
>   clone(CLONE_SIGHAND | CLONE_VM)
>   clone(CLONE_VM)

I might be missing something crucial here but
copy_process has the following:
        if (clone_flags & CLONE_THREAD) {
                p->exit_signal = -1;
                p->group_leader = current->group_leader;
                p->tgid = current->tgid;
        } else {
                if (clone_flags & CLONE_PARENT)
                        p->exit_signal = current->group_leader->exit_signal;
                else
                        p->exit_signal = (clone_flags & CSIGNAL);
                p->group_leader = p;
                p->tgid = p->pid;
        }

So clone without CLONE_THREAD should create a new thread group leader
and so create a new thread group. Unless there is some other trickery
which I do not see right now for_each_thread from the parent task
shouldn't see those which are cloned without CLONE_THREAD.

[...]
> --- a/fs/coredump.c
> +++ b/fs/coredump.c
> @@ -295,6 +295,8 @@ static int zap_process(struct task_struct *start, int exit_code, int flags)
>         for_each_thread(start, t) {
>                 task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK);
>                 if (t != current && t->mm) {
> +                       printk(KERN_INFO "Setting SIGKILL to %s(%u)\n",
> +                              t->comm, t->pid);
>                         sigaddset(&t->pending.signal, SIGKILL);
>                         signal_wake_up(t, 1);
>                         nr++;
> ---------- debug printk() patch end ----------

OK, but all your tasks should trigger SEGV. You cannot find out whether
all of them happened from the same zap_process, can you.
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-09-30 20:30 +0200
  Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending()check in oom_kill_process() Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-01 13:00 +0200
  Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Michal Hocko <mhocko@kernel.org> - 2015-10-01 14:50 +0200
    Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-10-01 17:10 +0200
      Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Michal Hocko <mhocko@kernel.org> - 2015-10-01 17:30 +0200
        Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-10-01 17:50 +0200
          Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Michal Hocko <mhocko@kernel.org> - 2015-10-01 18:20 +0200
            Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-10-01 20:00 +0200
              Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process() Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-02 13:40 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Michal Hocko <mhocko@kernel.org> - 2015-10-02 14:20 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process() Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-02 14:40 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Michal Hocko <mhocko@kernel.org> - 2015-10-02 15:40 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process() Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-02 16:10 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-10-02 16:20 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-10-02 16:10 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Michal Hocko <mhocko@kernel.org> - 2015-10-02 16:30 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong  fatal_signal_pending() check in oom_kill_process() Oleg Nesterov <oleg@redhat.com> - 2015-10-02 16:00 +0200
                Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process() Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-02 16:40 +0200

csiph-web