mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-pm@lists.osdl.org,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	linux-pm@osdl.org
Subject: Re: [linux-pm] OOPS: divide error while s2dsk (2.6.20-rc1-mm1)
Date: Mon, 18 Dec 2006 12:59:49 -0800	[thread overview]
Message-ID: <20061218125949.cf5787c8.akpm@osdl.org> (raw)
In-Reply-To: <4586C99C.9020606@gmail.com>

On Mon, 18 Dec 2006 18:02:20 +0100
Jiri Slaby <jirislaby@gmail.com> wrote:

> Rafael J. Wysocki wrote:
> > Hi,
> > 
> > On Monday, 18 December 2006 12:20, Jiri Slaby wrote:
> >> Hi.
> >>
> >> I got this oops while suspending:
> >> [  309.366557] Disabling non-boot CPUs ...
> >> [  309.386563] CPU 1 is now offline
> >> [  309.387625] CPU1 is down
> >> [  309.387704] Stopping tasks ... done.
> >> [  310.030991] Shrinking memory... -<0>divide error: 0000 [#1]
> >> [  310.456669] SMP
> >> [  310.456814] last sysfs file:
> >> /devices/pci0000:00/0000:00:1e.0/0000:02:08.0/eth0/statistics/collisions
> >> [  310.456919] Modules linked in: eth1394 floppy ohci1394 ide_cd ieee1394 cdrom
> >> [  310.457259] CPU:    0
> >> [  310.457260] EIP:    0060:[<c0150c9a>]    Not tainted VLI
> >> [  310.457261] EFLAGS: 00210246   (2.6.20-rc1-mm1 #207)
> >> [  310.457478] EIP is at shrink_slab+0x9e/0x169
> > 
> > Looks like we have a problem with slab shrinking here.
> > 
> > Could you please use gdb to check what exactly is at shrink_slab+0x9e?
> 
> Sure, but not till Friday, sorry (I am away).

I think there's only one divide in there which can do this, so...

--- a/mm/vmscan.c~shrink_slab-handle-bad-shrinkers
+++ a/mm/vmscan.c
@@ -20,6 +20,7 @@
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
+#include <linux/kallsyms.h>
 #include <linux/vmstat.h>
 #include <linux/file.h>
 #include <linux/writeback.h>
@@ -190,7 +191,13 @@ unsigned long shrink_slab(unsigned long 
 		unsigned long total_scan;
 		unsigned long max_pass = (*shrinker->shrinker)(0, gfp_mask);
 
-		delta = (4 * scanned) / shrinker->seeks;
+		if (!shrinker->seeks) {
+			print_symbol("shrinker %s has zero seeks\n",
+				(unsigned long)shrinker->shrinker);
+			delta = (4 * scanned) / DEFAULT_SEEKS;
+		} else {
+			delta = (4 * scanned) / shrinker->seeks;
+		}
 		delta *= max_pass;
 		do_div(delta, lru_pages + 1);
 		shrinker->nr += delta;
_

A quick grep shows that all set_shrinker() callers are doing the right
thing, so something kooky has happened.


  reply	other threads:[~2006-12-18 20:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-18 11:20 Jiri Slaby
2006-12-18 15:46 ` [linux-pm] " Rafael J. Wysocki
2006-12-18 17:02   ` Jiri Slaby
2006-12-18 20:59     ` Andrew Morton [this message]
2006-12-18 22:38     ` Rafael J. Wysocki
2006-12-18 22:44       ` Nigel Cunningham
2006-12-18 23:09         ` Rafael J. Wysocki
2006-12-18 23:16           ` Nigel Cunningham
2006-12-18 23:17       ` Andrew Morton
2006-12-19  0:52         ` Rafael J. Wysocki
2006-12-19  1:18         ` David Rientjes
2006-12-19  1:28           ` Andrew Morton

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=20061218125949.cf5787c8.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=linux-pm@osdl.org \
    --cc=rjw@sisk.pl \
    /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®