From: Michal Hocko <mhocko@suse.cz>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Tejun Heo <tj@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [Patch v4 1/2] freezer: check OOM kill while being frozen
Date: Thu, 11 Sep 2014 18:30:04 +0200 [thread overview]
Message-ID: <20140911163004.GN22042@dhcp22.suse.cz> (raw)
In-Reply-To: <CAM_iQpUP9kSGMs6Lq9tBLGaJrW6yyBWU5z38WzBiH4x-H_ZdYA@mail.gmail.com>
On Wed 10-09-14 13:30:25, Cong Wang wrote:
> On Mon, Sep 8, 2014 at 4:29 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> > On Mon, Sep 8, 2014 at 4:42 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >> On Monday, September 08, 2014 04:16:15 PM Cong Wang wrote:
> >>> On Mon, Sep 8, 2014 at 4:23 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >>> >
> >>> > The reason why it matters for the suspend-time freezing is that we freeze tasks
> >>> > to take them out of the picture entirely until they are thawed. Therefore we
> >>> > can't allow them to go back to the picture just for a while until they are
> >>> > killed. Frozen tasks are not supposed to get back to the picture at all.
> >>> >
> >>>
> >>>
> >>> Ok, then checking TIF_MEMDIE is unsafe for PM freeze, we should
> >>> keep the cgroup_freezing() test to make sure freeze request is from
> >>> cgroup not PM. Question got answered. :)
> >>
> >> Do I think correctly that cgroups freezing and system suspend are
> >> mutually exclusive? If not, then this still is problematic.
> >
> > Good point! Although rare, but it is possible we freeze a process both from
> > cgroup and PM. Hmm, this means we have to explicitly exclude PM rather
> > just checking cgroup freeze? Interesting, but I am not familiar with PM.
> >
>
> I am wondering if the folllowing check makes any sense with regarding
> to rule out PM freeze:
>
> if ((!pm_nosig_freezing && !pm_freezing) &&
> cgroup_freezing(current) && test_thread_flag(TIF_MEMDIE))
> return true;
Why is this needed in the first place? What if OOM happens in the middle
of task freezing during freeze_processes? Also killing a task at that
stage should be safe as no devices are suspended yet and OOM killer is
disabled after all tasks are frozen and allocations fail at that stage.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2014-09-11 16:30 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 22:30 Cong Wang
2014-09-04 22:30 ` [Patch v4 2/2] freezer: remove obsolete comments in __thaw_task() Cong Wang
2014-09-05 9:45 ` Michal Hocko
2014-09-05 14:09 ` Tejun Heo
2014-09-05 14:08 ` [Patch v4 1/2] freezer: check OOM kill while being frozen Tejun Heo
2014-09-05 16:31 ` Cong Wang
2014-09-05 18:00 ` Tejun Heo
2014-09-05 18:12 ` Cong Wang
2014-09-05 22:45 ` Tejun Heo
2014-09-05 23:32 ` Rafael J. Wysocki
2014-09-08 17:40 ` Cong Wang
2014-09-08 20:54 ` Rafael J. Wysocki
2014-09-08 20:58 ` Cong Wang
2014-09-08 21:53 ` Rafael J. Wysocki
2014-09-08 22:22 ` Tejun Heo
2014-09-08 22:48 ` Rafael J. Wysocki
2014-09-08 22:50 ` Tejun Heo
2014-09-08 23:15 ` Rafael J. Wysocki
2014-09-08 23:00 ` Cong Wang
2014-09-08 23:23 ` Rafael J. Wysocki
2014-09-08 23:16 ` Cong Wang
2014-09-08 23:42 ` Rafael J. Wysocki
2014-09-08 23:29 ` Cong Wang
2014-09-08 23:59 ` Rafael J. Wysocki
2014-09-10 20:30 ` Cong Wang
2014-09-10 23:38 ` Rafael J. Wysocki
2014-09-10 23:20 ` Cong Wang
2014-09-11 16:30 ` Michal Hocko [this message]
2014-09-12 23:59 ` Tejun Heo
2014-09-14 16:43 ` Rafael J. Wysocki
2014-09-15 0:56 ` Tejun Heo
2014-09-15 3:34 ` Rafael J. Wysocki
2014-09-15 9:36 ` Michal Hocko
2014-09-16 22:55 ` Cong Wang
2014-09-22 8:21 ` Michal Hocko
2014-09-09 15:16 ` Michal Hocko
2014-09-09 15:23 ` Tejun Heo
2014-09-09 16:06 ` Michal Hocko
2014-09-09 16:46 ` Tejun Heo
2014-09-09 17:12 ` Michal Hocko
2014-09-09 20:53 ` Rafael J. Wysocki
2014-09-10 13:24 ` Michal Hocko
2014-09-11 13:08 ` Michal Hocko
2014-09-11 14:17 ` Rafael J. Wysocki
2014-09-11 14:04 ` Michal Hocko
2014-09-11 14:26 ` Rafael J. Wysocki
2014-09-11 14:10 ` Michal Hocko
2014-09-11 14:32 ` Rafael J. Wysocki
2014-09-11 14:28 ` Michal Hocko
2014-09-11 14:52 ` Rafael J. Wysocki
2014-09-11 14:45 ` Michal Hocko
2014-09-14 16:39 ` Rafael J. Wysocki
2014-09-12 23:48 ` Tejun Heo
2014-09-15 14:28 ` Michal Hocko
2014-09-16 5:56 ` Tejun Heo
2014-09-09 20:48 ` Rafael J. Wysocki
2014-09-10 5:21 ` Cong Wang
2014-09-05 16:43 ` Cong Wang
2014-09-05 16:54 ` Michal Hocko
2014-09-15 11:22 ` Michal Hocko
2014-09-16 22:58 ` Cong Wang
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=20140911163004.GN22042@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®