public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Craig Milo Rogers <rogers@ISI.EDU>
To: Richard Gooch <rgooch@ras.ucalgary.ca>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Getting FS access events
Date: Tue, 15 May 2001 11:02:52 -0700	[thread overview]
Message-ID: <1486.989949772@ISI.EDU> (raw)
In-Reply-To: Your message of "Tue, 15 May 2001 00:49:58 MDT." <200105150649.f4F6nwD22946@vindaloo.ras.ucalgary.ca>

>And because your suspend/resume idea isn't really going to help me
>much. That's because my boot scripts have the notion of
>"personalities" (change the boot configuration by asking the user
>early on in the boot process). If I suspend after I've got XDM
>running, it's too late.

	Preface: As has been mentioned on this discussion thread, some
disk devices maintain a cache of their own, running on a small (by
today's standards) CPU.  These caches are probably sector oriented,
not block oriented, but are almost certainly not page oriented or
filesystem oriented.  Well, OK, some might have DOS filesystem
knowlege built-in, I suppose... yuck!

	Anyway, although there may be slight differences, they are
effectively block-orieted caches.  As long as they are write-through
(and/or there are cache flushing commands, etc), there are reasonably
coherent with the operating system's main cache, and they meet the
expectations of database programs, etc. that want stable storage.

	In terms of efficiency, there are questions about read-aheead,
write-behind, write-through with invalidation or write-through with
cache update -- the usual stuff.  I leave it as an exercise for the
reader to decide how to best tune their system, and merely assert that
it can be done.

	Imagine, as a mental exercise, that you move this
block-oriented cache out of the disk drive, and into the main CPU and
operating system, say roughly at the disk driver level.  We lose the
efficiency of having the small CPU do the block lookups, but a hashed
block lookup is rather cheap nowadays, wouldn't you say?  Ignoring
issues of, "What if the disk drive fails independently of the main
CPU, or vice versa?", the transplanted block cache should operate
pretty much as it did in the disk drive.

	In particular, it should continue to operate properly with the
main CPU's main page cache.

	Conclusion: a page cache can successfully run over a
appropriately designed block cache.  QED.

	What's the hitch?  It's the "appropriately designed"
constraint.  It is quite possible that the Linux block cache is not
designed (data strictures and code paths considered together) in a way
that allows it to mimic a simple disk drive's block cache.  I assume
that there's some impediment, or this discussion wouldn't have lasted
so long -- the idea of using the Linux block cache to model a disk
drive's block cache is pretty obvious, after all.

>So what I want is a solution that will keep the kernel clean (believe
>me, I really do want to keep it clean), but gives me a fast boot too.
>And I believe the solution is out there. We just haven't found it yet.

	Well, if you want a fast boot *on a single type of disk
drive*, and the existing Linux block cache doesn't work, you could
extend the driver for that hardware with an optional block cache,
independently of Linux' block cache, along with an appropriate
interface to populate it with boot-time blocks, and to flush it when
no longer needed.  That's not exactly clean, though, is it?

	You could extend the md (or LVM) drivers, or create a new
driver similar to one of them, that incorporates a simple block cache,
with appropriate mechanisms for populating and flushing it.  Clean?
er, no, rather muddy, in fact.

	You might want to lock down the pages that you've
prepopulated, rather than let them be discarded before they're needed.
This could be designed into a new block cache, but you might need to
play some accounting games to get it right with the existing block
cache.

	Finally, there's Linus' offer for a preread call, to
prepopulate the page cache.  By virtue of your knowlege of the
underlying implementation of the system, you could preload the file
system index pages into the block cache, and load the datd pages into
the page cache.  Clean!  Sewer-like!

						Craig Milo Rogers


  parent reply	other threads:[~2001-05-15 18:12 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200105140117.f4E1HqN07362@vindaloo.ras.ucalgary.ca>
2001-05-14  1:32 ` Getting FS access events Linus Torvalds
2001-05-14  1:45   ` Larry McVoy
2001-05-14  2:39     ` Richard Gooch
2001-05-14  3:09       ` Rik van Riel
2001-05-14  4:27         ` Richard Gooch
2001-05-15  4:37       ` Chris Wedgwood
2001-05-23 11:37         ` Stephen C. Tweedie
2001-05-14  2:24   ` Richard Gooch
2001-05-14  4:46     ` Linus Torvalds
2001-05-14  5:15       ` Richard Gooch
2001-05-14 13:04         ` Daniel Phillips
2001-05-14 18:00           ` Andreas Dilger
2001-05-14 20:16         ` Linus Torvalds
2001-05-14 23:19           ` Richard Gooch
2001-05-15  0:42             ` Daniel Phillips
2001-05-15  4:00             ` Linus Torvalds
2001-05-15  4:35               ` Larry McVoy
2001-05-15  4:57                 ` David S. Miller
2001-05-15  5:12                   ` Alexander Viro
2001-05-15  9:10                   ` Alan Cox
2001-05-15  9:48                     ` Lars Brinkhoff
2001-05-15  9:54                       ` Alexander Viro
2001-05-15 20:17                         ` Kai Henningsen
2001-05-15 20:58                           ` Alexander Viro
2001-05-15 21:08                             ` Alexander Viro
2001-05-15  4:59                 ` Alexander Viro
2001-05-15 17:01                   ` Pavel Machek
2001-05-15  4:43               ` Linus Torvalds
2001-05-15  5:04                 ` Alexander Viro
2001-05-15  6:20                 ` Richard Gooch
2001-05-15  6:28                   ` Linus Torvalds
2001-05-15  6:49                     ` Richard Gooch
2001-05-15  6:57                       ` Alexander Viro
2001-05-15 10:33                         ` Daniel Phillips
2001-05-15 10:44                           ` Alexander Viro
2001-05-15 14:42                             ` Daniel Phillips
2001-05-15  7:13                       ` Linus Torvalds
2001-05-15  7:56                         ` Chris Wedgwood
2001-05-15  8:06                           ` Linus Torvalds
2001-05-15  8:33                             ` Alexander Viro
2001-05-15 10:27                               ` David Woodhouse
2001-05-15 16:00                               ` Chris Mason
2001-05-15 19:26                               ` H. Peter Anvin
2001-05-15 20:03                                 ` Alexander Viro
2001-05-15 20:07                                   ` H. Peter Anvin
2001-05-15 20:15                                     ` Alexander Viro
2001-05-15 20:17                                       ` H. Peter Anvin
2001-05-15 20:22                                         ` Alexander Viro
2001-05-15 20:26                                           ` H. Peter Anvin
2001-05-15 20:31                                             ` Alexander Viro
2001-05-15 21:12                                               ` Linus Torvalds
2001-05-15 21:22                                               ` H. Peter Anvin
2001-05-15 21:02                                           ` Linus Torvalds
2001-05-15 21:53                                             ` Jan Harkes
2001-05-19  5:26                             ` Chris Wedgwood
2001-05-15 10:04                       ` Anton Altaparmakov
2001-05-15 19:28                         ` H. Peter Anvin
2001-05-15 22:31                           ` Albert D. Cahalan
2001-05-15 22:35                             ` H. Peter Anvin
2001-05-16  1:17                             ` Anton Altaparmakov
2001-05-16  1:30                               ` H. Peter Anvin
2001-05-16  8:34                               ` Anton Altaparmakov
2001-05-16 16:27                                 ` H. Peter Anvin
2001-05-15 16:26                       ` Pavel Machek
2001-05-15 18:02                       ` Craig Milo Rogers [this message]
2001-05-15 16:17                 ` Pavel Machek
2001-05-19 19:39                   ` Linus Torvalds
2001-05-19 19:44                     ` Pavel Machek
2001-05-19 19:47                       ` Linus Torvalds
2001-05-23 11:29                         ` Stephen C. Tweedie
2001-05-20  4:30                     ` Chris Wedgwood
2001-05-20 19:47                       ` Alan Cox
2001-05-18  7:55                 ` Rogier Wolff
2001-05-23 11:36                   ` Stephen C. Tweedie
2001-05-15  6:13               ` Richard Gooch

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=1486.989949772@ISI.EDU \
    --to=rogers@isi.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgooch@ras.ucalgary.ca \
    --cc=torvalds@transmeta.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