The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>
Subject: Re: Fw: 2.6.9-rc1-mm4: swsusp + AMD64 = LOCKUP on CPU0
Date: Wed, 8 Sep 2004 16:52:43 +0200	[thread overview]
Message-ID: <200409081652.43463.rjw@sisk.pl> (raw)
In-Reply-To: <20040908130049.GA15444@wotan.suse.de>

On Wednesday 08 of September 2004 15:00, Andi Kleen wrote:
> On Wed, Sep 08, 2004 at 02:51:55PM +0200, Rafael J. Wysocki wrote:
> > On Wednesday 08 of September 2004 14:01, Andi Kleen wrote:
> > > Pavel Machek <pavel@ucw.cz> writes:
> > > 
> > > > Hi!
> > > > 
> > > > > One for you guys on lkml ;)
> > > > 
> > > > It simply takes long to count pages (O(n^2) algorithm), so watchdog
> > > > triggers. I have better algorithm locally, but would like merge to
> > > > linus first. (I posted it to lkml some days ago, I can attach the
> > > > bigdiff).
> > > > 
> > > > Just disable the watchdog. Suspend *is* going to take time with
> > > > disabled interrupts.
> > > 
> > > 
> > > As a short term workaround you could also add touch_nmi_watchdog()s
> > > in that loop.
> > 
> > You mean like that:
> 
> I doubt this will help, because the number of zones is quite small.
> 
> Better check every N pages, e.g. N=100

I've done something like that:

--- swsusp.c.orig	2004-09-08 14:30:29.000000000 +0200
+++ swsusp.c	2004-09-08 15:56:55.000000000 +0200
@@ -38,6 +38,7 @@
 
 #include <linux/module.h>
 #include <linux/mm.h>
+#include <linux/nmi.h>
 #include <linux/suspend.h>
 #include <linux/smp_lock.h>
 #include <linux/file.h>
@@ -556,14 +557,19 @@
 {
 	struct zone *zone;
 	unsigned long zone_pfn;
+	unsigned nmi_cnt = 0;
 
 	nr_copy_pages = 0;
 
 	for_each_zone(zone) {
-		if (!is_highmem(zone)) {
-			for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn)
+		if (!is_highmem(zone))
+			for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn) {
 				nr_copy_pages += saveable(zone, &zone_pfn);
-		}
+				if (nmi_cnt++ >= 100) {
+					touch_nmi_watchdog();
+					nmi_cnt = 0;
+				}	
+			}
 	}
 }
 
and it works, but it seems to me that something similar is necessary for 
resuming (I get an NMI watchdog report if it's not disabled).

Greets,
RJW

-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

  reply	other threads:[~2004-09-08 14:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040908021637.57525d43.akpm@osdl.org.suse.lists.linux.kernel>
     [not found] ` <20040908102652.GA2921@atrey.karlin.mff.cuni.cz.suse.lists.linux.kernel>
2004-09-08 12:01   ` Fw: 2.6.9-rc1-mm4: swsusp + AMD64 = LOCKUP on CPU0 Andi Kleen
2004-09-08 12:51     ` Rafael J. Wysocki
2004-09-08 13:00       ` Andi Kleen
2004-09-08 14:52         ` Rafael J. Wysocki [this message]
2004-09-08 14:54           ` Pavel Machek
     [not found] <20040908021637.57525d43.akpm@osdl.org>
2004-09-08 10:26 ` Pavel Machek
2004-09-08 12:19   ` Rafael J. Wysocki
2004-09-08 12:55     ` Zwane Mwaikambo
2004-09-08 14:47       ` Rafael J. Wysocki
2004-09-08 20:47         ` 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=200409081652.43463.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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