mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Nick Piggin <npiggin@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.23-rc2-mm1: kernel BUG at mm/swap_state.c:78!
Date: Thu, 9 Aug 2007 16:37:35 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708091633540.8627@blonde.wat.veritas.com> (raw)
In-Reply-To: <200708091711.53898.m.kozlowski@tuxland.pl>

On Thu, 9 Aug 2007, Mariusz Kozlowski wrote:
> Hello,
> 
> 	Nothing unusual happening, allmodconfig compiling etc.
> Not sure why it says kernel was tainted though ... hmmm.
> 
> ------------[ cut here ]------------
> kernel BUG at mm/swap_state.c:78!
> invalid opcode: 0000 [#1]
> PREEMPT 
> Modules linked in: orinoco_cs orinoco hermes pl2303 usbserial pcmcia 8250_pci 8250 serial_core yenta_socket rsrc_nonstatic pcmcia_core 8139too
> CPU:    0
> EIP:    0060:[<c01504b7>]    Tainted: P        VLI
> EFLAGS: 00010246   (2.6.23-rc2-mm1 #1)
> EIP is at __add_to_swap_cache+0xc6/0xd7
> eax: 40000000   ebx: c11285c0   ecx: 000000d0   edx: 00000283
> esi: c11285c0   edi: 00000283   ebp: c1858f90   esp: c1858f84
> ds: 007b   es: 007b   fs: 0000  gs: 0000  ss: 0068
> Process kprefetchd (pid: 236, ti=c1858000 task=c18d14d0 task.ti=c1858000)
> Stack: 00000283 c11285c0 c3d5a3c8 c1858fa0 c01504ea c11285c0 00000000 c1858fcc 
>        c015307c 00000001 00000007 00000002 00000002 00000283 00000000 fffffffc 
>        00000000 c0152d5c c1858fe0 c0127f2e c0127ef8 00000000 00000000 00000000 
> Call Trace:
>  [<c010456a>] show_trace_log_lvl+0x1a/0x30
>  [<c0104629>] show_stack_log_lvl+0xa9/0xd5
>  [<c010486e>] show_registers+0x219/0x38d
>  [<c0104ae6>] die+0x104/0x23e
>  [<c0419bd3>] do_trap+0x83/0xad
>  [<c0104edf>] do_invalid_op+0x88/0x92
>  [<c04199b2>] error_code+0x6a/0x70
>  [<c01504ea>] add_to_swap_cache+0x22/0x58
>  [<c015307c>] kprefetchd+0x320/0x364
>  [<c0127f2e>] kthread+0x36/0x58
>  [<c0104233>] kernel_thread_helper+0x7/0x14
>  =======================
> INFO: lockdep is turned off.
> Code: 0f 89 7b 0c 83 05 fc c9 53 c0 01 8b 13 c1 ea 1e 8d 04 12 01 d0 c1 e0 03 29 d0 c1 e0 05 ff 80 b8 c0 53 c0 ff 05 34 1d 68 c0 eb 96 <0f> 0b eb fe 0f 0b eb fe 0f 0b eb fe 8b 53 0c eb be 55 89 e5 56 
> EIP: [<c01504b7>] __add_to_swap_cache+0xc6/0xd7 SS:ESP 0068:c1858f84

Don't worry about reproducing untainted, I got the same earlier
and was just preparing and testing the hotfix: here it is...


Nick's mm-clarify-__add_to_swap_cache-locking.patch is fine for mainline,
but soon generates a "kernel BUG at mm/swap_state.c:78!" when it meets
mm-implement-swap-prefetching.patch in 2.6.23-rc2-mm1.  We could add a
fix to the latter, but I think it's better to adjust Nick's, so that
it's right for whichever tree it's in: move the responsibility to
SetPageLocked from read_swap_cache_async to add_to_swap_cache.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 mm/swap_state.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- 2.6.23-rc2-mm1/mm/swap_state.c	2007-08-09 13:15:36.000000000 +0100
+++ linux/mm/swap_state.c	2007-08-09 14:40:27.000000000 +0100
@@ -100,15 +100,18 @@ int add_to_swap_cache(struct page *page,
 {
 	int error;
 
+	BUG_ON(PageLocked(page));
 	if (!swap_duplicate(entry)) {
 		INC_CACHE_INFO(noent_race);
 		return -ENOENT;
 	}
+	SetPageLocked(page);
 	error = __add_to_swap_cache(page, entry, GFP_KERNEL);
 	/*
 	 * Anon pages are already on the LRU, we don't run lru_cache_add here.
 	 */
 	if (error) {
+		ClearPageLocked(page);
 		swap_free(entry);
 		if (error == -EEXIST)
 			INC_CACHE_INFO(exist_race);
@@ -345,7 +348,6 @@ struct page *read_swap_cache_async(swp_e
 								vma, addr);
 			if (!new_page)
 				break;		/* Out of memory */
-			SetPageLocked(new_page);/* could be non-atomic op */
 		}
 
 		/*
@@ -369,9 +371,7 @@ struct page *read_swap_cache_async(swp_e
 		}
 	} while (err != -ENOENT && err != -ENOMEM);
 
-	if (new_page) {
-		ClearPageLocked(new_page);
+	if (new_page)
 		page_cache_release(new_page);
-	}
 	return found_page;
 }

  parent reply	other threads:[~2007-08-09 15:39 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09  8:51 2.6.23-rc2-mm1 Andrew Morton
2007-08-09 10:10 ` [usb-storage] schedule_timeout: wrong timeout value c1a95554 Mariusz Kozlowski
2007-08-09 14:43   ` [linux-usb-devel] " Alan Stern
2007-08-09 15:07     ` Rafael J. Wysocki
2007-08-09 15:20       ` Mariusz Kozlowski
2007-08-09 19:15         ` Rafael J. Wysocki
2007-08-09 12:53 ` 2.6.23-rc2-mm1 -- spinlock bad magic Andy Whitcroft
2007-08-09 17:17   ` Andy Whitcroft
2007-08-09 13:04 ` 2.6.23-rc2-mm1 -- PPC G5 kernel compile failure Andy Whitcroft
2007-08-09 14:20   ` 2.6.23-rc2-mm1 -- PPC G5 kernel compile failure (patch) Krzysztof Helt
2007-08-09 17:18     ` Andy Whitcroft
2007-08-10 13:09     ` Andy Whitcroft
2007-08-09 13:23 ` 2.6.23-rc2-mm1 Michal Piotrowski
2007-08-09 18:37   ` 2.6.23-rc2-mm1 Andrew Morton
2007-08-09 19:04     ` 2.6.23-rc2-mm1 Michal Piotrowski
2007-08-09 19:10       ` 2.6.23-rc2-mm1 Andrew Morton
2007-08-09 19:27         ` 2.6.23-rc2-mm1 Jeff Garzik
2007-08-09 13:51 ` 2.6.23-rc2-mm1: e1000e global symbols must be renamed Adrian Bunk
2007-08-09 17:06   ` [E1000-devel] " Kok, Auke
2007-08-09 14:24 ` 2.6.23-rc2-mm1: no bcm43xx Rafael J. Wysocki
2007-08-09 14:16   ` Michael Buesch
2007-08-09 15:11 ` 2.6.23-rc2-mm1: kernel BUG at mm/swap_state.c:78! Mariusz Kozlowski
2007-08-09 15:14   ` Adrian Bunk
2007-08-09 15:25     ` Mariusz Kozlowski
2007-08-09 15:37   ` Hugh Dickins [this message]
2007-08-09 16:00     ` Michal Piotrowski
2007-08-10  0:30     ` Nick Piggin
2007-08-09 15:36 ` 2.6.23-rc2-mm1 Michal Piotrowski
2007-08-09 16:19   ` 2.6.23-rc2-mm1 Michal Piotrowski
2007-08-09 17:04     ` 2.6.23-rc2-mm1 Andrew Morton
2007-08-09 16:31   ` 2.6.23-rc2-mm1 Andrew Morton
2007-08-09 20:17 ` 2.6.23-rc2-mm1: silly df numbers on 32bit extN Hugh Dickins
2007-08-09 20:56   ` Andrew Morton
2007-08-09 20:30 ` 2.6.23-rc2-mm1 Jesper Juhl
2007-08-09 21:36 ` 2.6.23-rc2-mm1 Gabriel C
2007-08-09 22:04   ` 2.6.23-rc2-mm1 Andrew Morton
2007-08-09 22:42     ` 2.6.23-rc2-mm1 Alan Cox
2007-08-09 23:33       ` 2.6.23-rc2-mm1 Gabriel C
2007-08-09 23:23 ` 2.6.23-rc2-mm1: sleeping function called from invalid context at kernel/mutex.c:86 Mariusz Kozlowski
2007-08-10  0:11   ` Andrew Morton
2007-08-10  5:36     ` Josh Triplett
2007-08-10  7:27       ` Mariusz Kozlowski
2007-08-10  7:40     ` Ingo Molnar
2007-08-10  7:55       ` Andrew Morton
2007-08-11  7:24         ` Alexey Dobriyan
2007-08-09 23:49 ` 2.6.23-rc2-mm1: rtl8139 inconsistent lock state Mariusz Kozlowski
2007-08-22 13:35   ` [PATCH 2.6.23-rc3-mm1] request_irq fix DEBUG_SHIRQ handling " Jarek Poplawski
2007-08-25  9:43     ` Mariusz Kozlowski
2007-08-27  5:54       ` Jarek Poplawski
2007-08-23  8:44   ` [PATCH (take 2)] " Jarek Poplawski
2007-08-24  5:46     ` Jarek Poplawski
2007-08-10  1:31 ` 2.6.23-rc2-mm1: rcutorture xtime usage Adrian Bunk
2007-08-10  2:00   ` Paul E. McKenney
2007-08-10  2:06     ` Andrew Morton
2007-08-10 15:12       ` Paul E. McKenney
2007-08-10 17:12         ` Andrew Morton
2007-08-10 20:30           ` Paul E. McKenney
2007-08-11  0:29             ` Paul E. McKenney
2007-08-11  4:47               ` Paul E. McKenney
2007-08-11 18:09               ` Ingo Molnar
2007-08-11 19:39                 ` Paul E. McKenney
2007-08-10  2:22     ` Adrian Bunk
2007-08-10  7:06 ` 2.6.23-rc2-mm1: irq lock inversion dependency detected Mariusz Kozlowski
2007-08-24  8:27   ` Jarek Poplawski
2007-08-24  8:50     ` Jarek Poplawski
2007-08-14 21:22 ` [-mm patch] make fs/nfsd/nfs4callback.c:do_probe_callback() static Adrian Bunk
2007-08-14 22:02   ` J. Bruce Fields
2007-08-14 21:23 ` [-mm patch] make drivers/ata/libata-scsi.c:ata_scsi_link_pm_policy() static Adrian Bunk
2007-08-14 21:23 ` [-mm patch] unexport ide_acpi_set_state Adrian Bunk
2007-08-14 21:23 ` [-mm patch] drivers/mtd/mtdbdi.c is no longer an own module Adrian Bunk

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=Pine.LNX.4.64.0708091633540.8627@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.kozlowski@tuxland.pl \
    --cc=npiggin@suse.de \
    /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®