From: Oleg Nesterov <oleg@redhat.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Cong Wang <xiyou.wangcong@gmail.com>,
David Rientjes <rientjes@google.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] oom: don't assume that a coredumping thread will exit soon
Date: Tue, 2 Dec 2014 18:50:41 +0100 [thread overview]
Message-ID: <20141202175041.GA20314@redhat.com> (raw)
In-Reply-To: <20141202091947.GB27014@dhcp22.suse.cz>
On 12/02, Michal Hocko wrote:
>
> On Fri 28-11-14 00:04:05, Oleg Nesterov wrote:
>
> > Note: this is only the first step, this patch doesn't try to solve other
> > problems. For example it doesn't try to clear the wrongly set TIF_MEMDIE
> > (SIGNAL_GROUP_COREDUMP check is obviously racy),
>
> I am not sure I understand this. What do you mean by wrongly set
> TIF_MEMDIE? That we give a process access to reserves even though it is
> already done with the coredumping?
I meant that (say) oom_kill_process() can set TIF_MEMDIE because
PF_EXITING && !SIGNAL_GROUP_COREDUMP, and after that this task can
participate the coredumping. For example, this thread can exit on its
own, but before it calls exit_mm() another thread can start the coredump.
In this case TIF_MEMDIE can fool oom-killer the same way,
oom_scan_process_thread() returns OOM_SCAN_ABORT if TIF_MEMDIE is set.
> > fatal_signal_pending() can be false positive, etc.
>
> When can this happen?
I meant "if (fatal_signal_pending(current) || task_will_free_mem(current))"
in out_of_memory(). Yes, sorry, "false positive" looks confusing. I meant
that fatal_signal_pending() can be true because of SIGNAL_GROUP_COREDUMP.
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>
> I guess the patch as is makes sense and it is an improvement. We need
> to call the helper in mem_cgroup_out_of_memory as well, though.
Yes, but can't we do this in a separate patch? try_charge() plays with
TIF_MEMDIE/PF_EXITING too, but probably this is fine.
> With that feel free to add
> Acked-by: Michal Hocko <mhocko@suse.cz>
Thanks.
> Also the original fix for the coredumping (edd45544c6f0 "oom: avoid
> deferring oom killer if exiting task is being traced") doesn't work
> really as per http://marc.info/?l=linux-kernel&m=141711049013620 then
> this and the follow up patch should be marked for stable I guess.
Perhaps this makes sense. It looks simple enough.
Oleg.
next prev parent reply other threads:[~2014-12-02 17:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 23:03 [PATCH 0/2] oom && coredump Oleg Nesterov
2014-11-27 23:04 ` [PATCH 1/2] oom: don't assume that a coredumping thread will exit soon Oleg Nesterov
2014-12-02 9:19 ` Michal Hocko
2014-12-02 17:50 ` Oleg Nesterov [this message]
2014-12-02 18:31 ` Michal Hocko
2014-12-02 19:16 ` Oleg Nesterov
2014-12-03 13:07 ` Michal Hocko
2014-11-27 23:04 ` [PATCH 2/2] oom: kill the insufficient and no longer needed PT_TRACE_EXIT check Oleg Nesterov
2014-12-02 9:35 ` Michal Hocko
2014-12-02 18:05 ` Oleg Nesterov
2014-12-02 18:23 ` Michal Hocko
2014-11-28 19:28 ` [PATCH 0/2] oom && coredump Oleg Nesterov
2014-12-03 19:50 ` [PATCH v2 0/1] oom: don't assume that a coredumping thread will exit soon Oleg Nesterov
2014-12-03 19:50 ` [PATCH v2 1/1] " Oleg Nesterov
2014-12-03 21:58 ` Andrew Morton
2014-12-04 14:34 ` Michal Hocko
2014-12-05 23:46 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141202175041.GA20314@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
--cc=rientjes@google.com \
--cc=rjw@rjwysocki.net \
--cc=tj@kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome