Re: swapon vs savecore dilemma

From: Terry Lambert <tlambert2_at_mindspring.com>
Date: Mon, 01 Sep 2003 19:30:06 -0700
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
Received on Mon Sep 01 2003 - 17:31:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:21 UTC