From: Michal Hocko <mhocko@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>,
pavel@ucw.cz, Oleg Nesterov <oleg@redhat.com>,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
rafael.j.wysocki@intel.com, chanho.min@lge.com,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] Revert "exec: make de_thread() freezable (was: Re: Linux 4.20-rc4)
Date: Tue, 4 Dec 2018 19:17:14 +0100 [thread overview]
Message-ID: <20181204181714.GR1286@dhcp22.suse.cz> (raw)
In-Reply-To: <CAHk-=wgaEw566btStrWE+NOgPJLn1whS-Yw1-=K2Qr6MDvSZ+A@mail.gmail.com>
On Tue 04-12-18 09:31:11, Linus Torvalds wrote:
> On Tue, Dec 4, 2018 at 1:58 AM Michal Hocko <mhocko@kernel.org> wrote:
> >
> > AFAIU both suspend and hibernation require the system to enter quiescent
> > state with no task potentially interfering with suspended devices. And
> > in this particular case those de-thread-ed threads will certainly not
> > interfere so silencing the lockdep sounds like a reasonable workaround.
>
> I still think it would be better to simply not freeze killed user processes.
>
> We already have things like
>
> if (test_tsk_thread_flag(p, TIF_MEMDIE))
> return false;
>
> exactly because we do not want to freeze processes that are about to
> die due to being killed. Very similar situation: we don't want to
> freeze those processes, because doing so would halt them from freeing
> the resources that may be needed for suspend or hibernate.
Yeah, we do not freeze oom victims but that is really far from trivial
to achieve. In order to do so we post-pone quiescent state until we know
all the TIF_MEMDIE threads are gone. See oom_killer_disable. In short it
is a painfull code.
> How about something like we set PF_NOFREEZE when we set PF_EXITING? At
> that point we've pretty much turned into a kernel thread, no?
Hmm, that doesn't sound like a bad idea but I am not sure it will
help because those threads we are waiting for might be block way before
they reached PF_EXITING. I would expect that threads that actually reach
that state usually die shortly. Unless I am missing something we are
talking about basically two cases here. Those threads are frozen while
de_thread waits for them because zap_other_threads cannot wake them from
the fridge or they are blocked in uninterruptible sleep somewhere in the
kernel. The later is the fundamental problem. The former could be hacked
around (check PF_FROZEN and use uninterruptible wake), I guess but I
haven't thought that through yet.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2018-12-04 18:17 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-25 23:02 Linux 4.20-rc4 Linus Torvalds
2018-12-03 7:47 ` [PATCH] Revert "exec: make de_thread() freezable (was: Re: Linux 4.20-rc4) Ingo Molnar
2018-12-03 8:39 ` Michal Hocko
2018-12-03 12:03 ` Rafael J. Wysocki
2018-12-03 12:31 ` Oleg Nesterov
2018-12-03 12:38 ` Michal Hocko
2018-12-03 13:10 ` Pavel Machek
2018-12-03 13:53 ` Michal Hocko
2018-12-03 14:14 ` Pavel Machek
2018-12-03 14:17 ` Michal Hocko
2018-12-03 14:45 ` Pavel Machek
2018-12-03 17:06 ` Linus Torvalds
2018-12-03 17:18 ` Michal Hocko
2018-12-03 18:55 ` Pavel Machek
2018-12-04 9:02 ` Ingo Molnar
2018-12-04 9:10 ` Michal Hocko
2018-12-04 9:33 ` Ingo Molnar
2018-12-04 9:58 ` Michal Hocko
2018-12-04 17:31 ` Linus Torvalds
2018-12-04 18:17 ` Michal Hocko [this message]
2018-12-04 19:33 ` Linus Torvalds
2018-12-04 19:49 ` Linus Torvalds
2018-12-04 20:05 ` Linus Torvalds
2018-12-04 19:55 ` Pavel Machek
2018-12-04 19:42 ` Pavel Machek
2018-12-04 19:29 ` Pavel Machek
2018-12-03 13:40 ` Oleg Nesterov
2018-12-03 11:56 ` Oleg Nesterov
2018-12-04 9:17 ` Ingo Molnar
2018-12-05 14:36 ` Oleg Nesterov
2018-12-06 8:54 ` Chanho Min
2018-12-06 8:57 ` Pavel Machek
2018-12-06 9:07 ` Chanho Min
2018-12-03 12:00 ` Rafael J. Wysocki
2018-12-04 8:42 ` Ingo Molnar
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=20181204181714.GR1286@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=chanho.min@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=pavel@ucw.cz \
--cc=rafael.j.wysocki@intel.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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®