mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>, Cong Wang <xiyou.wangcong@gmail.com>,
	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 16:17:56 +0200	[thread overview]
Message-ID: <2362560.tfnxFWQpxu@vostro.rjw.lan> (raw)
In-Reply-To: <20140911130840.GH22042@dhcp22.suse.cz>

On Thursday, September 11, 2014 03:08:40 PM Michal Hocko wrote:
> On Wed 10-09-14 15:24:17, Michal Hocko wrote:
> > On Tue 09-09-14 22:53:32, Rafael J. Wysocki wrote:
> > > On Wednesday, September 10, 2014 01:46:58 AM Tejun Heo wrote:
> > > > Hello,
> > > > 
> > > > On Tue, Sep 09, 2014 at 06:06:25PM +0200, Michal Hocko wrote:
> > > > > > Even for userland tasks, try_to_freeze() can currently be anywhere in
> > > > > > the kernel.  The frequently used ones are few but there are some odd
> > > > > 
> > > > > I always thought that user space tasks can be in the fridge only on the
> > > > > way out from the kernel (get_signal_to_deliver). I have quickly greped
> > > > 
> > > > It *can* be anywhere.  We used to have some deep in nfs.  They got
> > > > removed later due to deadlocks but in theory they still can be
> > > > anywhere.
> > > 
> > > Well, it would be good to determine the difference between theory and practice
> > > in this particular respect, because if in practice it can't be anywhere,
> > > we can just set an "every new instance of try_to_freeze() has to be documented"
> > > rule (which may not be a bad idea anyway) and disallow people to break things.
> > 
> > What do you think about this way to help distinguish kernel threads and
> > user processes and keep the future maintenance of freezer saner?
> 
> This is not enough. I have completely missed freezer_count... Will have
> to think about this. There is quite large base of callers of this... It
> won't be trivial to check whether all of them are safe. Especially after
> 467de1fc67d1b which made the functionality usable for !user tasks as
> well. Btw. is this even desirable? The follow up patch (33e638b9070b)
> have (ab)used freezer_{do_not_}count just to be reverted later by
> 72081624d5ad3. I haven't checked other kernel thread users which might be
> added later. Don't rather put try_to_freeze_user_task into freezer_count
> to reflect the original intention (assuming that a separate API for user
> and kthread is desirable of course).

Well, to me the only difference is that user space is frozen "automatically"
while kernel threads need to flag themselves as "freezable" and then call
try_to_freeze() directly somewhere.  Whether or not that difference is big
enough for a separate API is a good question and I'm not sure if they can be
entirely separate anyway.

And I'm still wondering if the OOM killer may be made avoid killing frozen
tasks.

Rafael


  reply	other threads:[~2014-09-11 13:58 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
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 [this message]
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=2362560.tfnxFWQpxu@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.com \
    --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®