From owner-freebsd-current@FreeBSD.ORG Mon Sep 1 19:31:47 2003 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 4C80816A4BF for ; Mon, 1 Sep 2003 19:31:47 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E6C344015 for ; Mon, 1 Sep 2003 19:31:45 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfj8a.dialup.mindspring.com ([165.247.205.10] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19u0xB-000414-00; Mon, 01 Sep 2003 19:31:34 -0700 Message-ID: <3F5400AE.74E1B6F@mindspring.com> Date: Mon, 01 Sep 2003 19:30:06 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Doug White References: <20030901165035.D58395@carver.gumbysoft.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4d6298061355a5336568ccd116ddffb26387f7b89c61deb1d350badd9bab72f9c350badd9bab72f9c cc: freebsd-current@freebsd.org Subject: Re: swapon vs savecore dilemma 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: Tue, 02 Sep 2003 02:31:47 -0000 Doug White wrote: > It looks like we may need to rethink the way swap is mounted at boot time > if we want crashdumps to work. > > Recently(?), a change was made so you can no longer open a swap partition > read/write after it is activated with swapon(8). In the current boot > sequence, swap is mounted before the root fsck starts so additional space > is available if the root fsck needs it. But at that point no partitions > are available for writing a core to, so we can't run savecore then. > > Without crashdumps debugging gets kind of interesting. > > Suggestions, other than have separate dump and swap partitions? There are a couple of stacked problems in this area: 1) How do I do a savecore, if the FS to which I want to write the crash dump image is dirty? 2) How to I do an fsck on a dirty FS to enable me to write a crash dump image, without overwriting the crash dump image itself? 3) How do I do a crash dump early on in the boot cycle, if the partition to which I'm dumping is not open for write? I think the main problem here is that we now swap on very early, on the theory that we have a very large FS that we need to fsck. Probably the correct thing to do is to fix fsck so that it doesn't need swap to run, even for a very large FS. This is relatively trivial to do, if you are willing to either change the on-disk layout, or do a little hocus-pocus with the contents of inode 1 (the "whiteout" file) to keep a rotating cylinder group bitmap log, and introduce stall barriers so that the number of simultaneously dirty cylinder groups is small enough that you could fit them in memory without swapping. Meanwhile, a workaround that would handle almost all the cases would be to *conditionally* do the swap-on, only if there is a dirty FS, and the checking of the FS would require swap in order to succeed. In general, people with huge FS's, if they care at all about system dumps, can set aside a separate space for them, while the majority of the rest of the work can fsck without them needing separate swap for it to succeed. That would at least restore the status-quo, pre the swapon change, for everyone whose fsck would have been successful without major surgery anyway. -- Terry