All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.16-rc1-mm3
Date: Thu, 26 Jan 2006 02:59:03 +1100	[thread overview]
Message-ID: <43D7A047.3070004@yahoo.com.au> (raw)
In-Reply-To: <6bffcb0e0601250340x6ca48af0w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

Hi,

Michal Piotrowski wrote:
> ------------[ cut here ]------------
> kernel BUG at /usr/src/linux-mm/include/linux/mm.h:302!
> invalid opcode: 0000 [#1]
> PREEMPT SMP DEBUG_PAGEALLOC
> last sysfs file: /class/vc/vcsa7/dev
> Modules linked in: binfmt_misc thermal fan processor ipv6 w83627hf
> hwmon_vid hwmon i2c_isa snd_intel8x0 snd_ac97_codec snd_ac97_bus
> sk98lin snd_pcm_oss snd_mixer_oss skge intel_agp snd_pcm snd_timer snd
> soundcore i2c_i801 parport_pc parport snd_page_alloc 8250_pnp 8250
> serial_core agpgart rtc ide_cd cdrom hw_random unix
> CPU:    0
> EIP:    0060:[<b013fe81>]    Not tainted VLI
> EFLAGS: 00210246   (2.6.16-rc1-mm3 #1)
> EIP is at release_pages+0x33/0x15e

Is it repeatable?

If so, I'd imagine it must be a specific driver page which is not properly
refcounted somewhere. A bug in generic code would have shown up elsewhere
by now.

Can you try something like the attached patch and see what it gives you?

Thanks,
Nick

-- 
SUSE Labs, Novell Inc.


[-- Attachment #2: mm-debug-refcount.patch --]
[-- Type: text/plain, Size: 1875 bytes --]

Index: linux-2.6/include/linux/mm.h
===================================================================
--- linux-2.6.orig/include/linux/mm.h
+++ linux-2.6/include/linux/mm.h
@@ -15,6 +15,7 @@
 #include <linux/prio_tree.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
+#include <linux/kallsyms.h>
 
 struct mempolicy;
 struct anon_vma;
@@ -264,6 +265,8 @@ struct page {
 	void *virtual;			/* Kernel virtual address (NULL if
 					   not kmapped, ie. highmem) */
 #endif /* WANT_PAGE_VIRTUAL */
+
+	void *debug;
 };
 
 #define page_private(page)		((page)->private)
@@ -294,8 +297,14 @@ struct page {
  */
 static inline int put_page_testzero(struct page *page)
 {
-	BUG_ON(atomic_read(&page->_count) == 0);
-	return atomic_dec_and_test(&page->_count);
+	if (unlikely(atomic_read(&page->_count) == 0)) {
+		printk(KERN_WARNING "put_page_testzero found free page (flags = %lx)\n", page->flags);
+		if (page->debug)
+			print_symbol(KERN_WARNING "nopage is %s\n", (unsigned long)page->debug);
+		WARN_ON(1);
+		return 0;
+	} else
+		return atomic_dec_and_test(&page->_count);
 }
 
 /*
Index: linux-2.6/mm/memory.c
===================================================================
--- linux-2.6.orig/mm/memory.c
+++ linux-2.6/mm/memory.c
@@ -2056,6 +2056,8 @@ retry:
 	if (new_page == NOPAGE_OOM)
 		return VM_FAULT_OOM;
 
+	new_page->debug = (struct address_space *)vma->vm_ops->nopage;
+
 	/*
 	 * Should we do an early C-O-W break?
 	 */
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -521,6 +521,8 @@ static int prep_new_page(struct page *pa
 	if (PageReserved(page))
 		return 1;
 
+	page->debug = NULL;
+
 	page->flags &= ~(1 << PG_uptodate | 1 << PG_error |
 			1 << PG_referenced | 1 << PG_arch_1 |
 			1 << PG_checked | 1 << PG_mappedtodisk);

  reply	other threads:[~2006-01-25 15:59 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-25  7:24 2.6.16-rc1-mm3 Andrew Morton
2006-01-25  8:38 ` [PATCH] convert a for (i = 0 ; i < NR_CPUS ; i++) to for_each_cpu(i) in sched_init() Eric Dumazet
2006-01-25  8:42   ` [PATCH, resent] " Eric Dumazet
2006-01-25  9:14     ` [PATCH] convert a for (i = 0 ; i < NR_CPUS ; i++) to for_each_cpu(i) in files_defer_init() Eric Dumazet
2006-01-25 12:01     ` [PATCH, resent] convert a for (i = 0 ; i < NR_CPUS ; i++) to for_each_cpu(i) in sched_init() Ingo Molnar
2006-01-25  9:01 ` [PATCH] mips: follow the change of split_page() Yoichi Yuasa
2006-01-25  9:16 ` 2.6.16-rc1-mm3: mips, sparc64 split_page breakage Alexey Dobriyan
2006-01-25  9:26 ` [PATCH -mm] Mark ppc_htab_operations as const Alexey Dobriyan
2006-01-25  9:32 ` [PATCH -mm] s390: dasd_eckd: add missing } Alexey Dobriyan
2006-01-25 10:44 ` 2.6.16-rc1-mm3 Reuben Farrelly
2006-01-26  5:39   ` [linux-usb-devel] 2.6.16-rc1-mm3 Greg KH
2006-01-27 12:46     ` Reuben Farrelly
2006-01-27 17:27       ` Greg KH
2006-01-27 17:49         ` 2.6.16-rc1-mm3 Pete Zaitcev
2006-01-27 19:40           ` 2.6.16-rc1-mm3 Reuben Farrelly
2006-01-27 19:57             ` 2.6.16-rc1-mm3 Pete Zaitcev
2006-01-25 11:40 ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-01-25 15:59   ` Nick Piggin [this message]
2006-01-26 19:02     ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-01-26 19:47       ` 2.6.16-rc1-mm3 Nick Piggin
2006-01-26 19:50         ` 2.6.16-rc1-mm3 Nick Piggin
2006-01-27 10:11           ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-02-01  8:30             ` 2.6.16-rc1-mm3 Nick Piggin
2006-02-01  8:51               ` 2.6.16-rc1-mm3 Andrew Morton
2006-02-02 21:06                 ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-02-02 22:20                   ` 2.6.16-rc1-mm3 Andrew Morton
2006-02-02 23:48                     ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-02-03  0:12                     ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-01-26 19:58         ` 2.6.16-rc1-mm3 Michal Piotrowski
2006-01-25 14:06 ` 2.6.16-rc1-mm3 Andy Whitcroft
2006-01-25 14:44   ` 2.6.16-rc1-mm3 Pekka Enberg
2006-01-25 16:46     ` 2.6.16-rc1-mm3 Andy Whitcroft
2006-01-25 18:16       ` 2.6.16-rc1-mm3 Pekka Enberg
2006-01-25 21:06         ` 2.6.16-rc1-mm3 Andy Whitcroft
2006-01-26  7:03           ` 2.6.16-rc1-mm3 Pekka Enberg
2006-01-27  0:20             ` 2.6.16-rc1-mm3 Andy Whitcroft
2006-01-27  3:23               ` 2.6.16-rc1-mm3 Andrew Morton
2006-01-27  6:03                 ` 2.6.16-rc1-mm3 Eric Dumazet
2006-01-27 10:12                   ` 2.6.16-rc1-mm3 Andy Whitcroft
2006-01-27 10:37                     ` 2.6.16-rc1-mm3 Eric Dumazet
2006-01-25 19:55 ` 2.6.16-rc1-mm3 / netfilter / firehol problems? thunder7
2006-01-25 20:59   ` Jiri Slaby
2006-01-26  8:29     ` Harald Welte
2006-01-26  5:29 ` [BUG] Invalid sleeping function call in 2.6.16-rc1-mm3 Peter Williams
2006-01-26 18:13 ` 2.6.16-rc1-mm3 (soft lockup) Dominik Karall
2006-01-26 19:01 ` 2.6.16-rc1-mm3 (psmouse.c) Dominik Karall
2006-01-26 22:23 ` [RFC: -mm patch] drivers/serial/jsm/: cleanups Adrian Bunk
2006-01-27 11:47 ` 2.6.16-rc1-mm3 Reuben Farrelly
  -- strict thread matches above, loose matches on Subject: below --
2006-01-25  7:24 2.6.16-rc1-mm3 Andrew Morton
2006-01-25 13:48 2.6.16-rc1-mm3 Alexander Gran
2006-01-25 17:21 ` 2.6.16-rc1-mm3 Andrew Morton
2006-01-26  1:48   ` 2.6.16-rc1-mm3 Alexander Gran

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=43D7A047.3070004@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.