From owner-freebsd-current@FreeBSD.ORG Fri Sep 24 16:12:54 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A888416A4D9; Fri, 24 Sep 2004 16:12:54 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B24443D54; Fri, 24 Sep 2004 16:12:54 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i8OGD0qR000787; Fri, 24 Sep 2004 12:13:00 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i8OGCuoY000779; Fri, 24 Sep 2004 12:12:56 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Fri, 24 Sep 2004 12:12:56 -0400 From: David Schultz To: Pawel Jakub Dawidek Message-ID: <20040924161255.GA699@VARK.MIT.EDU> Mail-Followup-To: Pawel Jakub Dawidek , Jun Kuriyama , Current References: <7m7jqjhojv.wl@black.imgsrc.co.jp> <20040924122508.GG9550@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040924122508.GG9550@darkness.comp.waw.pl> cc: Jun Kuriyama cc: Current Subject: Re: panic: swap_pager_isswapped: failed to locate all swap meta blocks X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2004 16:12:54 -0000 On Fri, Sep 24, 2004, Pawel Jakub Dawidek wrote: > On Fri, Sep 24, 2004 at 08:52:20PM +0900, Jun Kuriyama wrote: > +> > +> This is current as of 2004.09.23.23.00.00+00 (when I hit "shutdown -r > +> now"). > +> > +> ----- > +> Shutting down local daemons:. > +> Writing entropy file:. > +> panic: swap_pager_isswapped: failed to locate all swap meta blocks > +> cpuid = 1 > +> KDB: enter: panic > +> [thread 100138] > +> Stopped at kdb_enter+0x2b: nop > +> db> tr > +> kdb_enter(c068a149) at kdb_enter+0x2b > +> panic(c069dbcc,1000000,20000020,0,c43ee000) at panic+0x127 > +> swap_pager_isswapped(c42c44a4,c392e880,c42c44a4,0,c069dec7,18c) at swap_pager_isswapped+0xf6 > +> vm_proc_swapin_all(c392e880,c072d540,0,c069da42,8b6) at vm_proc_swapin_all+0x6a > +> swapoff(c3b8bc00,ecda9d14,1,1,296) at swapoff+0x1b6 > +> syscall(2f,2f,2f,8049368,1) at syscall+0x213 > +> Xint0x80_syscall() at Xint0x80_syscall+0x1f > +> --- syscall (424, FreeBSD ELF32, swapoff), eip = 0x280c066b, esp = 0xbfbfee0c, ebp = 0xbfbfee28 --- > +> ----- > +> > +> I have a core if you want. Sorry, I just committed a patch that I believe will fix this. > This is indirectly caused by me. I added 'stop' method to rc.d/swap1 script > and now swapoff(8) is done on every shutdown(8) run. > > Will it be possible to fix it or should I made this optional? One thing worth pointing out is that the present swapoff(2) implementation can be pretty slow if there's a lot of stuff swapped out. It swaps data in synchronously, one page at a time. It would not be difficult to improve on this, but it isn't a priority. You might want to look at how fast it is and see if this is acceptable.[1] One way to speed it up would be to wait until after most userland processes have been killed, since most of the data won't need to be swapped back in in that case. In fact, this is an improvement for another reason, namely, there might not be enough physical memory for swapoff() to work otherwise. [1] On the other hand, one advantage of having it invoked on shutdown is that it will be tested routinely. ;-)