public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Jackson <jerj@coplanar.net>
To: root@chaos.analogic.com
Cc: Brian Gerst <bgerst@didntduck.org>,
	Otto Wyss <otto.wyss@bluewin.ch>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Linux should better cope with power failure
Date: Mon, 19 Mar 2001 17:15:38 -0500	[thread overview]
Message-ID: <3AB6850A.4D7FDA26@coplanar.net> (raw)
In-Reply-To: <Pine.LNX.3.95.1010319162020.12070A-100000@chaos.analogic.com>

"Richard B. Johnson" wrote:

> On Mon, 19 Mar 2001, Brian Gerst wrote:
> [SNIPPED...]
>
> >
> > At the very least the disk should be consistent with memory.  If the
> > dirty pages aren't written back to the disk (but not necessarily removed
> > from memory) after a reasonable idle period, then there is room for
> > improvement.
> >
>
> Hmmm. Now think about it a minute. You have a database operation
> with a few hundred files open, most of which will be deleted after
> a sort/merge completes. At the same time, you've got a few thousand
> directories with their ATIME being updated. Also, you have thousands
> of temporary files being created in /tmp during a compile that didn't
> use "-pipe".
>
> If you periodically write everything to disk, you don't have many
> CPU cycles available to do anything useful.
>
> It is up to the application to decide if anything is 'precious'.
> If you've got some database running, it's got to be checkpointed
> with some "commitable" file-system so it can be interrupted at any time.
>
> If you make your file-systems up of "slices", you can mount the
> executable stuff read/only. Currently, only /var and /tmp need to
> be writable for normal use, plus any user "slices", of course.
>  -- Yes I know you need to modify /etc/stuff occasionally (startup
> and shutdown, plus an occasional password change). I proposed
> a long time ago that /etc/mtab get moved to /var.

so how does mount update /var/mtab when mounting var? he he.

Actually, I think /etc/mtab is not needed at all.   Originally, UNIX
used to put as much onto the disk (and not in "core") as possible.
so much state information related only to one boot-cycle was
taken out of kernel and stored on disk.  /var/run/utmp, /etc/mtab,
, rmtab,  and many others.  all are invalidated by a reboot, and are yet
stored
in non-volatile storage.  kernel memory is not swappable, so they manually
separated out the minimum needed in core.

Linux currently has a lot of this info in core, and maintains the disk files
for backwards compatibility.  in the case of /etc/mtab, I believe
/proc/mounts
has the same info.  It appears to be in the same format as /etc/mtab,
so most of the groundwork has already been done.
i've considered trying just changing /etc/mtab to /proc/mounts in some
utilities, to remove the need for read-write root.  This (and other cases)
would guarantee consistency (look at /etc/mtab after restart in single
user more - ugh)

I wonder if embedded folks would like to at least keep the old behaviour
as a compile-time option;  they're in almost the same boat as early (64k
core memory) unix folks.

My favorite compromise between journaling and performance is the
compaq smart array controllers, with a battery-backed sram
write cache;  they can do (fast)lazy writes and still be perfectly reliable.
plus they keep *everything* reliable, not just metadata.

I find this a fascinating topic... the ultimate would be to use the nvram
(it's mostly empty if using LinuxBIOS)  to store a clean shutdown flag,
and/or a system heartbeat timestamp (like syslogd's)... only this timestamp
would let the hdd spin down (not hit every 20 minutes or so with a timestamp
log entry) and not wear out a flash disk based system.

Regards,

Jeremy


  parent reply	other threads:[~2001-03-19 22:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-19 19:46 Linux should better cope with power failure Otto Wyss
2001-03-19 19:59 ` Charles Cazabon
2001-03-19 20:15 ` Richard B. Johnson
2001-03-19 20:51   ` Brian Gerst
2001-03-19 21:08     ` Jeremy Jackson
2001-03-19 21:35     ` Richard B. Johnson
2001-03-19 21:59       ` Brian Gerst
2001-03-19 22:15       ` Jeremy Jackson [this message]
2001-03-19 15:14         ` Ben Ford
2001-03-19 23:07   ` Werner Almesberger
2001-03-19 20:19 ` William T Wilson
  -- strict thread matches above, loose matches on Subject: below --
2001-03-19 21:16 Torrey Hoffman
2001-03-19 22:28 ` Stephen Satchell
2001-03-19 23:05   ` Andre Hedrick
2001-03-19 22:11 Stephen Gutknecht (linux-kernel)
2001-03-19 22:39 ` Otto Wyss
2001-03-20 21:38   ` H. Peter Anvin
2001-03-19 22:35 Otto Wyss
2001-03-19 23:12 ` John R Lenton
2001-03-23 15:28 David Balazic
2001-03-23 18:22 ` Gerhard Mack
2001-03-26  9:34   ` David Balazic
2001-03-23 19:29 ` Otto Wyss
2001-03-23 22:41   ` David Ford
2001-03-24  8:44     ` Otto Wyss
2001-03-24  9:47       ` David Ford
2001-03-24 10:28         ` Otto Wyss
2001-03-26 10:22     ` David Balazic
2001-03-26 10:17   ` David Balazic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AB6850A.4D7FDA26@coplanar.net \
    --to=jerj@coplanar.net \
    --cc=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=otto.wyss@bluewin.ch \
    --cc=root@chaos.analogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox