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


Groups > linux.kernel > #1235342 > unrolled thread

[PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer

Started byOleg Nesterov <oleg@redhat.com>
First post2015-09-29 18:00 +0200
Last post2015-09-30 18:50 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to  oom-killer Oleg Nesterov <oleg@redhat.com> - 2015-09-29 18:00 +0200
    Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-09-30 13:50 +0200
      Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly  to oom-killer Oleg Nesterov <oleg@redhat.com> - 2015-09-30 16:20 +0200
        Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-09-30 18:20 +0200
          Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly  to oom-killer Oleg Nesterov <oleg@redhat.com> - 2015-09-30 18:50 +0200

#1235342 — [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer

FromOleg Nesterov <oleg@redhat.com>
Date2015-09-29 18:00 +0200
Subject[PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer
Message-ID<qe5tT-2x8-3@gated-at.bofh.it>
Just in case, this doesn't depend on the previous series I sent.

Tetsuo, iirc we already discussed the change in 1/2 some time ago,
could you review?

Oleg.

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

[toc] | [next] | [standalone]


#1236203 — Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer

FromTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date2015-09-30 13:50 +0200
SubjectRe: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer
Message-ID<qeo3w-3UA-1@gated-at.bofh.it>
In reply to#1235342
Oleg Nesterov wrote:
> Just in case, this doesn't depend on the previous series I sent.
> 
> Tetsuo, iirc we already discussed the change in 1/2 some time ago,
> could you review?
> 
> Oleg.

I tested patch 1/2 and 2/2 on next-20150929 using reproducer at
http://lkml.kernel.org/r/201503150240.GII00591.OVSFtQLOFOHJMF@I-love.SAKURA.ne.jp .

  $ while :; do ./a.out; done

Unfortunately, since hangup on coredump to pipe occurs sometimes,
I can't tell whether this patchset solves hangup on coredump to pipe.
--
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/

[toc] | [prev] | [next] | [standalone]


#1236346 — Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer

FromOleg Nesterov <oleg@redhat.com>
Date2015-09-30 16:20 +0200
SubjectRe: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer
Message-ID<qeqoG-7qA-13@gated-at.bofh.it>
In reply to#1236203
On 09/30, Tetsuo Handa wrote:
>
> Oleg Nesterov wrote:
> > Just in case, this doesn't depend on the previous series I sent.
> >
> > Tetsuo, iirc we already discussed the change in 1/2 some time ago,
> > could you review?
> >
> > Oleg.
>
> I tested patch 1/2 and 2/2 on next-20150929 using reproducer at
> http://lkml.kernel.org/r/201503150240.GII00591.OVSFtQLOFOHJMF@I-love.SAKURA.ne.jp .
>
>   $ while :; do ./a.out; done
>
> Unfortunately, since hangup on coredump to pipe occurs sometimes,
> I can't tell whether this patchset solves hangup on coredump to pipe.

Obviously it doesn't. There are a lot more problems here.

It is hardly possible to enumerate them, but let me quote the changelog
from d003f371b27016354c

    Note: this is only the first step, this patch doesn't try to solve other
    problems.  The SIGNAL_GROUP_COREDUMP check is obviously racy, a task can
    participate in coredump after it was already observed in PF_EXITING state,
    so TIF_MEMDIE (which also blocks oom-killer) still can be wrongly set.
    fatal_signal_pending() can be true because of SIGNAL_GROUP_COREDUMP so
    out_of_memory() and mem_cgroup_out_of_memory() shouldn't blindly trust it.
    And even the name/usage of the new helper is confusing, an exiting thread
    can only free its ->mm if it is the only/last task in thread group.

This patch just makes the SIGNAL_GROUP_COREDUMP check in task_will_free_mem()
a bit more correct wrt CLONE_VM tasks, nothing more.

Oleg.

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

[toc] | [prev] | [next] | [standalone]


#1236494 — Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer

FromTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date2015-09-30 18:20 +0200
SubjectRe: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer
Message-ID<qesgO-1GU-31@gated-at.bofh.it>
In reply to#1236346
Oleg Nesterov wrote:
> This patch just makes the SIGNAL_GROUP_COREDUMP check in task_will_free_mem()
> a bit more correct wrt CLONE_VM tasks, nothing more.

OK. Then, that's out of what I can understand. But I wish for
some description to PATCH 2/2 about why to change from
"do { } while_each_thread()" to "for_each_thread() { }"
because they seem to traverse differently.



#define __for_each_thread(signal, t)    \
	list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node)

#define for_each_thread(p, t)           \
	__for_each_thread((p)->signal, t)

static inline struct task_struct *next_thread(const struct task_struct *p)
{
	return list_entry_rcu(p->thread_group.next,
			      struct task_struct, thread_group);
}

#define while_each_thread(g, t) \
	while ((t = next_thread(t)) != g)
--
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/

[toc] | [prev] | [next] | [standalone]


#1236538 — Re: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer

FromOleg Nesterov <oleg@redhat.com>
Date2015-09-30 18:50 +0200
SubjectRe: [PATCH 0/2] coredump: make SIGNAL_GROUP_COREDUMP more friendly to oom-killer
Message-ID<qesJR-2eW-35@gated-at.bofh.it>
In reply to#1236494
On 10/01, Tetsuo Handa wrote:
>
> Oleg Nesterov wrote:
> > This patch just makes the SIGNAL_GROUP_COREDUMP check in task_will_free_mem()
> > a bit more correct wrt CLONE_VM tasks, nothing more.
>
> OK. Then, that's out of what I can understand. But I wish for
> some description to PATCH 2/2 about why to change from
> "do { } while_each_thread()" to "for_each_thread() { }"

while_each_thread() is deprecated, see 0c740d0afc

> because they seem to traverse differently.

Not really. And in this particular case (start from group leader)
even the order is the same, although this doesn't matter. Well,
except for_each_thread(p, t) can find no threads, but this is fine
too; this means that they all (including the leader) have exited.

Oleg.

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web