linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* page_launder() bug
@ 2001-05-06 21:08 BERECZ Szabolcs
  2001-05-06 21:59 ` Jonathan Morton
                   ` (3 more replies)
  0 siblings, 4 replies; 104+ messages in thread
From: BERECZ Szabolcs @ 2001-05-06 21:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm

Hi!

there is a bug in page_launder introduced with kernel 2.4.3-ac12.
if the swapfile is on a filesystem, then after swapping out some
pages, the system locks up. sometimes it writes an oops message.
I don't know exactly what's the problem, but with the attached
patch it works. (this is just a reverse patch to go back to
pre 2.4.3-ac12, and it's against 2.4.4-ac5)
please fix the bug, or apply this patch until fixed properly.

a question:
why don't you include lkcd or something like that in the
mainstream kernel? it would be much easier to save those annoying
oopses :)

Bye,
Szabi


diff -Nur linux/mm/vmscan.c linux.swapfix/mm/vmscan.c
--- linux/mm/vmscan.c	Sun May  6 15:59:22 2001
+++ linux.swapfix/mm/vmscan.c	Sun May  6 16:07:09 2001
@@ -448,15 +448,9 @@
 	maxscan = nr_inactive_dirty_pages;
 	while ((page_lru = inactive_dirty_list.prev) != &inactive_dirty_list &&
 				maxscan-- > 0) {
-		int dead_swap_page;
-
 		page = list_entry(page_lru, struct page, lru);
 		zone = page->zone;

-		dead_swap_page =
-			(PageSwapCache(page) &&
-			 page_count(page) == (1 + !!page->buffers));
-
 		/* Wrong page on list?! (list corruption, should not happen) */
 		if (!PageInactiveDirty(page)) {
 			printk("VM: page_launder, wrong page on list.\n");
@@ -467,10 +461,9 @@
 		}

 		/* Page is or was in use?  Move it to the active list. */
-		if (!dead_swap_page &&
-		    (PageTestandClearReferenced(page) || page->age > 0 ||
-		     (!page->buffers && page_count(page) > 1) ||
-		     page_ramdisk(page))) {
+		if (PageTestandClearReferenced(page) || page->age > 0 ||
+				(!page->buffers && page_count(page) > 1) ||
+				page_ramdisk(page)) {
 			del_page_from_inactive_dirty_list(page);
 			add_page_to_active_list(page);
 			continue;
@@ -512,11 +505,8 @@
 			if (!writepage)
 				goto page_active;

-			/* First time through? Move it to the back of the list,
-			 * but not if it is a dead swap page. We want to reap
-			 * those as fast as possible.
-			 */
-			if (!launder_loop && !dead_swap_page) {
+			/* First time through? Move it to the back of the list */
+			if (!launder_loop) {
 				list_del(page_lru);
 				list_add(page_lru, &inactive_dirty_list);
 				UnlockPage(page);


^ permalink raw reply	[flat|nested] 104+ messages in thread
* Re: page_launder() bug
@ 2001-05-07  0:32 Jonathan Lundell
  0 siblings, 0 replies; 104+ messages in thread
From: Jonathan Lundell @ 2001-05-07  0:32 UTC (permalink / raw)
  To: linux-kernel

At 12:07 AM +0200 2001-05-07, BERECZ Szabolcs wrote:
>On Sun, 6 May 2001, Jonathan Morton wrote:
>
>  > >-			 page_count(page) == (1 + !!page->buffers));
>>
>>  Two inversions in a row?  I'd like to see that made more explicit,
>>  otherwise it looks like a bug to me.  Of course, if it IS a bug...
>it's not a bug.
>if page->buffers is zero, than the page_count(page) is 1, and if
>page->buffers is other than zero, page_count(page) is 2.
>so it checks if page is really used by something.
>maybe this last line is not true, but the !!page->buffers is not a bug.

There's something to be said for expressing it a little more clearly:

	page_count(page) == (page->buffers ? 2 : 1);

(sorry, I don't remember the relative precedence of == and ?:)
-- 
/Jonathan Lundell.

^ permalink raw reply	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2001-11-21 21:30 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-06 21:08 page_launder() bug BERECZ Szabolcs
2001-05-06 21:59 ` Jonathan Morton
2001-05-06 22:07   ` BERECZ Szabolcs
2001-05-07  4:55 ` David S. Miller
2001-05-07  5:19   ` Aaron Lehmann
2001-05-07  6:26   ` Tobias Ringstrom
2001-05-07  8:59     ` Helge Hafting
2001-05-07 19:02       ` J . A . Magallon
2001-05-08  7:52         ` Helge Hafting
2001-05-10 12:19           ` Ingo Oeser
2001-05-10 10:51         ` Anuradha Ratnaweera
2001-05-07 10:52     ` Alan Cox
2001-05-07 13:49     ` Daniel Phillips
2001-05-07 13:53     ` H. Peter Anvin
2001-05-07  8:54   ` David S. Miller
2001-05-07 15:12     ` Tobias Ringstrom
2001-05-07 14:52   ` Horst von Brand
     [not found]     ` <davem@redhat.com>
2001-11-21  7:16       ` [VM/MEMORY-SICKNESS] 2.4.15-pre7 kmem_cache_create invalid opcode Jeff V. Merkey
2001-11-21  6:22         ` David S. Miller
2001-11-21  6:47           ` David S. Miller
2001-11-21  6:54             ` Jeff Merkey
2001-11-21  6:56             ` David S. Miller
2001-11-21  7:03               ` Jeff Merkey
2001-11-21  7:49                 ` arjan
2001-11-21 18:31                   ` Jeff Merkey
2001-11-21 19:06                     ` Doug Ledford
2001-11-21 19:51                       ` Jeff Merkey
2001-11-21 19:58                         ` J Sloan
2001-11-21 20:38                         ` Doug Ledford
2001-11-21 21:17                           ` Jeff Merkey
2001-11-21 19:16                     ` Arjan van de Ven
2001-11-21 19:53                       ` Jeff Merkey
2001-11-21 20:36                         ` Doug Ledford
2001-11-21 21:16                           ` Jeff Merkey
2001-11-21 21:28                           ` Robert Love
2001-11-21  7:09               ` David S. Miller
2001-11-21  7:14                 ` Jeff Merkey
2001-11-21  7:28               ` Stuart Young
2001-11-21  7:33           ` Jeff V. Merkey
2001-11-21  6:54             ` Chris Abbey
2001-11-21  7:05               ` Jeff Merkey
2001-11-21  6:47         ` Kai Henningsen
2001-11-21 18:28           ` Jeff Merkey
2001-11-21  8:49         ` Alan Cox
2001-11-21 18:28           ` Jeff Merkey
2001-05-08 17:59   ` page_launder() bug Kai Henningsen
2001-05-09  2:32   ` Rusty Russell
2001-05-09  8:43     ` Martin Dalecki
2001-05-09  3:36   ` Jonathan Morton
2001-05-07 17:59 ` Linus Torvalds
2001-05-07 21:22   ` Marcelo Tosatti
2001-05-07 23:23     ` Linus Torvalds
2001-05-07 21:50       ` Marcelo Tosatti
2001-05-07 23:52         ` Linus Torvalds
2001-05-07 22:26           ` Marcelo Tosatti
2001-05-08  2:29             ` Linus Torvalds
2001-05-13 16:08               ` Rik van Riel
2001-05-13 19:29                 ` Linus Torvalds
2001-05-14 22:05                   ` Marcelo Tosatti
2001-05-08  0:16           ` David S. Miller
2001-05-08  2:34             ` Linus Torvalds
2001-05-08  1:40               ` Marcelo Tosatti
2001-05-08  3:46                 ` Linus Torvalds
2001-05-08  2:37                   ` Marcelo Tosatti
2001-05-08 21:16                   ` Marcelo Tosatti
2001-05-08 23:38                     ` Linus Torvalds
2001-05-08 23:53                       ` Marcelo Tosatti
2001-05-09  2:13                       ` David S. Miller
2001-05-09 17:38                         ` Marcelo Tosatti
2001-05-09 20:05                         ` David S. Miller
2001-05-09 18:40                           ` Marcelo Tosatti
2001-05-09 21:08                           ` David S. Miller
2001-05-09 19:50                             ` Marcelo Tosatti
2001-05-13 16:34                         ` Rik van Riel
2001-05-13 19:34                           ` Linus Torvalds
2001-05-13 19:39                             ` Rik van Riel
2001-05-13 20:42                               ` Linus Torvalds
2001-05-14  7:05                                 ` Kai Henningsen
2001-05-13 17:52                         ` David S. Miller
2001-05-13 17:55                           ` Rik van Riel
2001-05-13 18:00                           ` David S. Miller
2001-05-08  6:50                 ` David S. Miller
2001-05-08  7:40                   ` Linus Torvalds
2001-05-08 18:53                     ` Marcelo Tosatti
2001-05-08  8:29                   ` David S. Miller
2001-05-08  3:22               ` David S. Miller
2001-05-08  3:26                 ` Linus Torvalds
2001-05-08  2:47             ` David S. Miller
2001-05-08  1:34               ` Marcelo Tosatti
2001-05-08  3:18               ` David S. Miller
2001-05-08  1:47                 ` Marcelo Tosatti
2001-05-08  3:24                 ` Linus Torvalds
2001-05-08  3:29                 ` David S. Miller
2001-05-08 10:36                   ` BERECZ Szabolcs
2001-05-08 12:33             ` Mikulas Patocka
2001-05-13 16:24               ` Rik van Riel
2001-05-13 21:02                 ` Another VM race? (was: page_launder() bug) Mikulas Patocka
2001-05-13 23:04                   ` Rik van Riel
2001-05-14  9:53                     ` Mikulas Patocka
2001-05-08  0:06         ` page_launder() bug David S. Miller
2001-05-07 23:31     ` David S. Miller
2001-05-07 22:44 ` David S. Miller
2001-05-08  1:00   ` Horst von Brand
2001-05-07  0:32 Jonathan Lundell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).