public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Gautham R Shenoy <ego@in.ibm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Nigel Cunningham <nigel@nigel.suspend2.net>,
	Oleg Nesterov <oleg@tv-sign.ru>, Pavel Machek <pavel@ucw.cz>,
	Maximilian Engelhardt <maxi@daemonizer.de>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [RFC][PATCH][EXPERIMENTAL] Make kernel threads nonfreezable by default
Date: Mon, 28 May 2007 10:09:05 +0200	[thread overview]
Message-ID: <200705281009.06685.rjw@sisk.pl> (raw)
In-Reply-To: <200705270012.59177.rjw@sisk.pl>

On Sunday, 27 May 2007 00:12, Rafael J. Wysocki wrote:
> Hi,
> 
> Following the "Freezing of kernel threads" discussion
> (http://lkml.org/lkml/2007/5/12/162) I have created a patch that changes the
> freezer's behavior with respect to kernel threads.  Namely, with the patch
> applied all kernel threads are nonfreezable by default (have PF_NOFREEZE set)
> and the ones that want to be frozen need to call set_freezable() (which clears
> PF_NOFREEZE for them) and try_to_freeze().  The other (nonfreezable) kernel
> threads don't need to call try_to_freeze() any more.
> 
> I have removed try_to_freeze() from a handful of kernel threads that I think
> need not be freezable, but in many cases I wasn't quite sure whether or not
> it was a good idea to change the current behavior.  For this reason I've added
> set_freezable() to the majority of (currently freezable) kernel threads that
> belong to device drivers and filesystems.
> 
> Of course, I have removed the setting of PF_NOFREEZE from the kernel threads
> that are currently nonfreezable, since with the other changes in the patch it
> isn't necessary any more.
> 
> This patch is on top of the "Freezer: Avoid freezing kernel threads prematurely"
> patch that I posted yestarday, available at http://lkml.org/lkml/2007/5/25/199
> (updated version that applies cleanly on top of 2.6.22-rc3, is available at
> http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.22-rc3/patches/07-freezer-avoid-freezing-kernel-threads-prematurely.patch).
> It has been tested on a couple of machines and doesn't seem to break anything.
> 
> [As you can see there are quite a lot of files affected, so I didn't add all
> maintainers of them to the CC list.  In fact, I'm not sure how to handle
> notifying them of the change, so please advise.]

Does the lack of comments mean that everyone on the CC list agrees with this
approach? ;-)

In the meantime, it turns out that this patch fixes the hibernation/suspend
problem with cryptd discussed in the thread at
http://lkml.org/lkml/2007/5/26/24 .

The problem is that cryptd doesn't call try_to_freeze() and doesn't set
PF_NOFREEZE for itself, so the freezer cannot handle it properly.  In principle
we can add either try_to_freeze() or the setting of PF_NOFREEZE to it, but if
the approach in the $subject patch is acceptable, we'll need to remove that
soon.  So, what should we do?

Rafael


  reply	other threads:[~2007-05-28  8:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-26 22:12 [RFC][PATCH][EXPERIMENTAL] Make kernel threads nonfreezable by default Rafael J. Wysocki
2007-05-28  8:09 ` Rafael J. Wysocki [this message]
2007-05-28 10:30   ` Pavel Machek
2007-05-28 18:11     ` Rafael J. Wysocki
2007-05-28  9:46 ` Nigel Cunningham
2007-05-28 18:17   ` Rafael J. Wysocki
2007-05-28 21:26     ` Nigel Cunningham
2007-05-28 22:51       ` Rafael J. Wysocki
2007-05-28 22:54         ` Nigel Cunningham
2007-05-30 22:01       ` [RFC][PATCH -mm] Freezer: " Rafael J. Wysocki
2007-05-28 10:33 ` [RFC][PATCH][EXPERIMENTAL] " Pavel Machek
2007-05-28 18:11   ` Rafael J. Wysocki
2007-05-29 11:31     ` Pavel Machek
2007-05-29 12:15       ` Rafael J. Wysocki
2007-05-29 12:48         ` Pavel Machek
2007-05-29 21:55           ` Rafael J. Wysocki
2007-05-29 12:59         ` Nigel Cunningham
2007-05-29 22:13           ` Rafael J. Wysocki
2007-05-29 22:15             ` Nigel Cunningham
2007-05-29 15:01         ` Linus Torvalds

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=200705281009.06685.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=ego@in.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxi@daemonizer.de \
    --cc=nigel@nigel.suspend2.net \
    --cc=oleg@tv-sign.ru \
    --cc=pavel@ucw.cz \
    --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