From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 30 02:20:15 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED54916A4BF for ; Sat, 30 Aug 2003 02:20:15 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5191C43FF7 for ; Sat, 30 Aug 2003 02:20:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7U9KFUp035222 for ; Sat, 30 Aug 2003 02:20:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7U9KF4K035217; Sat, 30 Aug 2003 02:20:15 -0700 (PDT) Date: Sat, 30 Aug 2003 02:20:15 -0700 (PDT) Message-Id: <200308300920.h7U9KF4K035217@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Heiko Weber" Subject: Re: kern/44950: SMP kernel crash in vm_page_free: freeing wired page X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Heiko Weber List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Aug 2003 09:20:16 -0000 The following reply was made to PR kern/44950; it has been noted by GNATS. From: "Heiko Weber" To: , Cc: Subject: Re: kern/44950: SMP kernel crash in vm_page_free: freeing wired page Date: Sat, 30 Aug 2003 11:09:49 +0200 Thanks to Tor Egge, he send me a kernel patch for the vm. The system is up without a panic after installing the patch. Maybe it will help others to get a more stable SMP system. Tor Egge suggested, that the problem can also happen on a single processor. I run 4.8-STABLE here ... maybe the bug is fixed in -CURRENT, would be good to put the fix in the upcoming 4.9-STABLE ? Heiko Index: sys/vm/vm_page.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_page.c,v retrieving revision 1.147.2.18 diff -u -r1.147.2.18 vm_page.c --- sys/vm/vm_page.c 10 Mar 2002 05:03:19 -0000 1.147.2.18 +++ sys/vm/vm_page.c 6 Aug 2003 23:09:58 -0000 @@ -1403,7 +1408,8 @@ { int s; - if ((m->flags & (PG_BUSY|PG_UNMANAGED)) || m->busy || m->wire_count) { + if ((m->flags & (PG_BUSY|PG_UNMANAGED)) || m->busy || + m->hold_count || m->wire_count) { printf("vm_page_cache: attempting to cache busy page\n"); return; } Index: sys/kern/sys_pipe.c =================================================================== RCS file: /home/ncvs/src/sys/kern/sys_pipe.c,v retrieving revision 1.60.2.14 diff -u -r1.60.2.14 sys_pipe.c --- sys/kern/sys_pipe.c 3 Aug 2003 13:04:57 -0000 1.60.2.14 +++ sys/kern/sys_pipe.c 6 Aug 2003 23:09:58 -0000 @@ -561,12 +561,12 @@ int j; for (j = 0; j < i; j++) - vm_page_unwire(wpipe->pipe_map.ms[j], 1); + vm_page_unhold(wpipe->pipe_map.ms[j]); return (EFAULT); } m = PHYS_TO_VM_PAGE(paddr); - vm_page_wire(m); + vm_page_hold(m); wpipe->pipe_map.ms[i] = m; } @@ -627,7 +627,7 @@ } } for (i = 0; i < wpipe->pipe_map.npages; i++) - vm_page_unwire(wpipe->pipe_map.ms[i], 1); + vm_page_unhold(wpipe->pipe_map.ms[i]); wpipe->pipe_map.npages = 0; } Index: sys/miscfs/procfs/procfs_mem.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/procfs/Attic/procfs_mem.c,v retrieving revision 1.46.2.3 diff -u -r1.46.2.3 procfs_mem.c --- sys/miscfs/procfs/procfs_mem.c 22 Jan 2002 17:22:59 -0000 1.46.2.3 +++ sys/miscfs/procfs/procfs_mem.c 6 Aug 2003 23:09:58 -0000 @@ -188,9 +188,9 @@ } /* - * Wire the page into memory + * Hold the page in memory */ - vm_page_wire(m); + vm_page_hold(m); /* * We're done with tmap now. @@ -212,7 +212,7 @@ /* * release the page and the object */ - vm_page_unwire(m, 1); + vm_page_unhold(m); vm_object_deallocate(object); object = NULL; --- Wecos - Heiko Weber Computer Systeme Tel. +49 (4169) 91000 <> Fax +49 (4169) 919033