From: Jonathan Morton <chromi@cyberspace.org>
To: linux-kernel@vger.kernel.org
Subject: Re: [rfc] Near-constant time directory index for Ext2
Date: Fri, 23 Feb 2001 12:20:54 +0000 [thread overview]
Message-ID: <l03130300b6bbd7483cd3@[192.168.239.101]> (raw)
In-Reply-To: <UTC200102230249.DAA252851.aeb@vlet.cwi.nl>
>Now that you provide source for r5 and dx_hack_hash, let me feed my
>collections to them.
>r5: catastrophic
>dx_hack_hash: not bad, but the linear hash is better.
<snip verbose results>
So, not only does the linear hash normally provide a shorter worst-case
chain, its' results are actually more consistent than the other two. Looks
like simple is good here, but is it still possible to produce
"pathological" sets for the linear hash to see how badly it falls down?
I'm no mathematician, so I'll leave that to the gurus...
Meanwhile, let's go back to Linus' comment on compatibility and so on. He
has a *very* good point, which I'll expand on slightly here:
Suppose some stone-age Linux user, running 2.0.35 or something equally old
(which runs ext2), decides to finally bite the bullet and upgrade to the
all-new 2.6.1 (OK, this is some time in the future). 2.6.1 implements some
"enhanced" version of ext2 which makes some incompatible modifications to
the directory structure. However, since the process of upgrading through
such a massive range of kernels also involves upgrading most other software
to boot, this user forgot one or two pieces, and reboots to 2.0.35 to
regain a sufficiently working system that he can build the updated software
- or not, because 2.0.35's old ext2 code suddenly can't read the
filesystem, which was modified by 2.6.1 before the boot process stalled.
e2fsck is no help here either, because he now has an unbootable system with
old software that doesn't understand the new stuff.
I hope people understand this as well as I do - if a filesystem upgrade is
desirable, let the user perform some *specific* action to upgrade it, when
he has an otherwise-working setup *and* sufficient backups. I for one do
not want to be caught out like the hypothetical user I mentioned above.
OTOH, I have my own opinions on the direction of ext2:
- Currently, it's a stable and universally-utilised filesystem which offers
very good performance for most applications. I'm specifically drawing
attention to certain benchmarks which place ext2's disk-based performance
ahead of many commercial UNIX' ram-based filesystem performance.
- There are specific problems with performance when reading and/or
modifying large directories. I haven't tested for this personally, but I
have noticed slowness when using 'rm -rf' on a large *tree* of directories.
The problem appeared to be one of disk access, but may be a side-effect of
poor storage distribution (I haven't examined the ext2 code). Related to
this, rebuilding the slocate database on all my systems appears to be
disk-bound rather than CPU-bound, and takes too long for my liking.
One of the current suggestions, if I've interpreted it correctly, is to
introduce an extension to ext2 which essentially makes a "fast index" of a
large directory, attaches it to the directory in some backwards-compatible
manner, and uses it *in conjunction with* the regular directory structure.
This is probably a good idea, but it needs some thought:
- How much overhead does the "fast index" introduce for modification of the
directory? Large directories are the most likely to have stuff added and
deleted, and it doesn't help if during an "rm *" operation the saving on
the search is negated by the overhead on the unlink.
- If the index gets out of sync with the directory, how is this detected
and recovered from? Assuming the index merely points to the correct
position in the regular directory, some simple sanity checks will suffice
for most cases (is this entry in the directory the same as I asked for?),
and if the entry is not in the index then a standard search of the real
directory can be done. In either case, the index can be marked as invalid
(and removed?) and rebuilt whenever necessary.
- At what threshold of directory size does the index come into play?
(fairly obviously, the index is useless for tiny directories)
- What happens when an old kernel encounters a directory which has an index
attached to it? Does it look like a virtual file, which has no special
properties but whose name is reserved for system use? (cf. lost+found) Or
is it some inidentifiable bits in the directory structure and a few lost
clusters on the disk? If the latter, it will have to be done in a way that
older versions of e2fsck can clean it up easily and older versions of ext2
won't throw up on it, which could be kinda hard. If the former, an
'unused' name will have to be found to avoid conflicts but the big
advantage is *no* inconsistency with old systems.
Answers on a postcard...
--------------------------------------------------------------
from: Jonathan "Chromatix" Morton
mail: chromi@cyberspace.org (not for attachments)
big-mail: chromatix@penguinpowered.com
uni-mail: j.d.morton@lancaster.ac.uk
The key to knowledge is not to rely on people to teach you it.
Get VNC Server for Macintosh from http://www.chromatix.uklinux.net/vnc/
-----BEGIN GEEK CODE BLOCK-----
Version 3.12
GCS$/E/S dpu(!) s:- a20 C+++ UL++ P L+++ E W+ N- o? K? w--- O-- M++$ V? PS
PE- Y+ PGP++ t- 5- X- R !tv b++ DI+++ D G e+ h+ r- y+
-----END GEEK CODE BLOCK-----
next prev parent reply other threads:[~2001-02-23 12:22 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-23 2:49 Andries.Brouwer
2001-02-23 3:42 ` Daniel Phillips
2001-02-23 12:20 ` Jonathan Morton [this message]
2001-02-23 18:57 ` Andreas Dilger
-- strict thread matches above, loose matches on Subject: below --
2001-02-23 12:38 Andries.Brouwer
2001-02-23 1:52 Andries.Brouwer
2001-02-23 21:43 ` Ralph Loader
2001-02-23 22:37 ` Guest section DW
2001-02-24 2:47 ` Ralph Loader
2001-02-24 5:34 ` Ralph Loader
[not found] <Pine.LNX.4.10.10102211740550.1933-100000@coffee.psychology.mcmaster.ca>
2001-02-21 22:47 ` H. Peter Anvin
2001-02-20 15:04 Daniel Phillips
2001-02-20 20:03 ` Linus Torvalds
2001-02-20 21:08 ` Jeremy Jackson
2001-02-20 21:20 ` Mike Dresser
2001-02-20 22:36 ` Jeremy Jackson
2001-02-20 23:08 ` Daniel Phillips
2001-02-21 1:04 ` Bernd Eckenfels
2001-02-21 16:38 ` Daniel Phillips
2001-02-20 22:58 ` Jonathan Morton
2001-02-20 21:41 ` Daniel Phillips
2001-02-21 0:22 ` Linus Torvalds
2001-02-21 0:30 ` Alan Cox
2001-02-21 2:35 ` Ed Tomlinson
2001-02-21 23:13 ` Linus Torvalds
2001-02-21 23:34 ` Davide Libenzi
2001-02-21 23:59 ` Linus Torvalds
2001-02-21 23:57 ` H. Peter Anvin
2001-02-22 0:35 ` Ed Tomlinson
2001-02-21 1:01 ` Andreas Dilger
2001-02-22 2:28 ` Daniel Phillips
2001-02-22 3:30 ` Linus Torvalds
2001-02-22 16:33 ` Chris Mason
2001-02-22 22:30 ` Daniel Phillips
2001-02-21 17:21 ` Davide Libenzi
2001-02-21 21:08 ` Martin Mares
2001-02-21 21:29 ` Davide Libenzi
2001-02-21 21:32 ` Martin Mares
2001-02-21 21:59 ` Davide Libenzi
2001-02-21 22:26 ` Martin Mares
2001-02-21 22:43 ` Davide Libenzi
2001-02-21 22:14 ` H. Peter Anvin
2001-02-21 22:32 ` Martin Mares
2001-02-21 22:38 ` H. Peter Anvin
2001-02-21 22:50 ` Martin Mares
2001-02-21 22:54 ` H. Peter Anvin
2001-02-21 23:07 ` Martin Mares
2001-02-21 23:15 ` H. Peter Anvin
2001-02-21 23:42 ` Daniel Phillips
2001-02-21 23:52 ` Davide Libenzi
[not found] ` <3A945081.E6EB78F4@innominate.de>
2001-02-21 23:48 ` H. Peter Anvin
2001-02-22 1:22 ` Daniel Phillips
2001-02-22 1:42 ` H. Peter Anvin
2001-02-22 2:03 ` Andreas Dilger
2001-02-22 2:41 ` H. Peter Anvin
2001-02-22 3:43 ` Daniel Phillips
2001-02-22 4:02 ` Linus Torvalds
2001-02-22 5:19 ` Linus Torvalds
2001-02-22 11:31 ` Ingo Oeser
2001-02-22 18:20 ` Linus Torvalds
2001-02-22 4:02 ` H. Peter Anvin
2001-02-22 7:03 ` Andreas Dilger
2001-02-22 4:03 ` H. Peter Anvin
2001-02-22 10:35 ` Alan Cox
2001-02-23 0:59 ` Felix von Leitner
2001-02-22 3:08 ` Daniel Phillips
2001-02-22 7:20 ` Bill Wendling
2001-02-22 8:34 ` Rogier Wolff
2001-02-21 23:26 ` Jamie Lokier
2001-02-22 19:04 ` Kai Henningsen
2001-02-22 18:38 ` Kai Henningsen
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='l03130300b6bbd7483cd3@[192.168.239.101]' \
--to=chromi@cyberspace.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®