mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: linux-mtd@lists.infradead.org
Cc: "Pete MacKay" <armlinux@architechnical.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] Freezer: Fix JFFS2 garbage collector freezing issue (was: Re: JFFS2 garbage collection threads not freezing?)
Date: Sat, 1 Dec 2007 21:14:10 +0100	[thread overview]
Message-ID: <200712012114.10881.rjw@sisk.pl> (raw)
In-Reply-To: <36289.69.30.123.186.1196443476.squirrel@architechnical.net>

On Friday, 30 of November 2007, Pete MacKay wrote:
> We've ported from 2.6.18 to 2.6.24-rc3 on a pxa270-based machine and can
> no longer enter 'standby' or 'mem' states.  I've stripped down the kernel
> and talked with the freezer maintainer and we believe the jffs2 garbage
> collection threads may not be calling try_to_freeze() or marking
> themselves properly.  (We have two mounted jffs2 file systems - mtd2 and
> mtd3).  The following is some cleaned-up output:
> 
> Freezing remaining freezable tasks ...
> Freezing of tasks failed after 20.00 seconds (2 tasks refusing to freeze):
>   task                PC stack   pid father
> init          D c0244b90     0     1      0
> kthreadd      S c0244b90     0     2      0
> ksoftirqd/0   S c0244b90     0     3      2
> events/0      S c0244b90     0     4      2
> khelper       S c0244b90     0     5      2
> kblockd/0     S c0244b90     0    51      2
> ksuspend_usbd D c0244b90     0    59      2
> khubd         D c0244b90     0    64      2
> kseriod       D c0244b90     0    67      2
> pdflush       D c0244b90     0    90      2
> pdflush       D c0244b90     0    91      2
> kswapd0       D c0244b90     0    92      2
> aio/0         S c0244b90     0    93      2
> mtdblockd     S c0244b90     0   192      2
> udevd         D c0244b90     0   619      1
> jffs2_gcd_mtd R running      0  1533      2
> jffs2_gcd_mtd R running      0  1598      2
> syslogd       D c0244b90     0  2248      1
> klogd         D c0244b90     0  2250      1
> hcid          D c0244b90     0  2273      1
> sdpd          D c0244b90     0  2277      1
> hidd          D c0244b90     0  2281      1
> sh            D c0244b90     0  2292      1
> getty         D c0244b90     0  2293      1
> echo          R running      0  2303   2292
>  jffs2_gcd_mtd2
>  jffs2_gcd_mtd3
> 
> Restarting tasks ... done.

I think that the appended patch is necessary to fix this problem.

Greetings,
Rafael

---
Subject: Freezer: Fix JFFS2 garbage collector freezing issue
From: Rafael J. Wysocki <rjw@sisk.pl>

Fix breakage caused by commit d5d8c5976d6adeddb8208c240460411e2198b393
"freezer: do not send signals to kernel threads" in
jffs2_garbage_collect_thread() that assumed it would be sent signals
by the freezer.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Pete MacKay <armlinux@architechnical.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 fs/jffs2/background.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux-2.6/fs/jffs2/background.c
===================================================================
--- linux-2.6.orig/fs/jffs2/background.c
+++ linux-2.6/fs/jffs2/background.c
@@ -103,15 +103,17 @@ static int jffs2_garbage_collect_thread(
 		   get there first. */
 		yield();
 
+		/* If system suspend is in progress, go to the refrigerator and
+		   start again when the suspend is done */
+		if (try_to_freeze())
+			goto again;
+
 		/* Put_super will send a SIGKILL and then wait on the sem.
 		 */
 		while (signal_pending(current)) {
 			siginfo_t info;
 			unsigned long signr;
 
-			if (try_to_freeze())
-				goto again;
-
 			signr = dequeue_signal_lock(current, &current->blocked, &info);
 
 			switch(signr) {

       reply	other threads:[~2007-12-01 19:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <36289.69.30.123.186.1196443476.squirrel@architechnical.net>
2007-12-01 20:14 ` Rafael J. Wysocki [this message]
2007-12-04  0:05   ` Rafael J. Wysocki

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=200712012114.10881.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=armlinux@architechnical.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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®