From: Ted Ts'o <tytso@mit.edu>
To: Andreas Dilger <aedilger@gmail.com>
Cc: Jeff Moyer <jmoyer@redhat.com>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: An idea for supporting large directories and readdir+stat workloads
Date: Sat, 11 Aug 2012 17:25:32 -0400 [thread overview]
Message-ID: <20120811212532.GB906@thunk.org> (raw)
I was thinking about how to respond to Andreas's offer:
On Fri, Aug 10, 2012 at 05:14:12PM -0600, Andreas Dilger wrote:
> We have a patch to fix the 2-level htree and 2GB directory size limits
> already, in case that is of interest to anyone.
where in theory, I'd be interested, but there have been enough other
performance problems with really large directories that it was never
been clear to me it would be a huge win, and given the many other
changes queued up, I was hesitant.
... and then I started thinking about this while I was in the shower,
and I think I've come up with a really good solution to the problem.
What if we also integrated the proposed extension that you guys have
designed for storing additional metadata in the directory, and then
for files that do not have hard links, we keep a copy of all of the fs
metadata required for stat(2) in the directory?
This would speed up the readdir() + stat(2) workload, which has always
been the major problem, in the common case where a file is linked to
via only a single directory. If a file gets hard-linked, we will need
to drop the copy in the directory and then make sure the fields in the
inode table are up-to-date. But if we do this, I think it would be a
huge improvement for ext4.
What do folks think?
- Ted
P.S. We might need to add a special case hack for the SELINUX sid,
and put it in the extended directory entry as well, since otherwise
every single stat operation will need to go to the inode table just to
read the SELINUX extended attribute. But I don't really care about
that, since my personal answer to SELINUX has been "just say no". But
I do know there are enough people using it that we probably do need to
accomodate those poor folks....
next reply other threads:[~2012-08-11 21:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-11 21:25 Ted Ts'o [this message]
2012-08-13 5:11 ` An idea for supporting large directories and readdir+stat workloads Andreas Dilger
2012-08-13 14:36 ` Theodore Ts'o
2012-08-13 14:39 ` Theodore Ts'o
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=20120811212532.GB906@thunk.org \
--to=tytso@mit.edu \
--cc=aedilger@gmail.com \
--cc=jmoyer@redhat.com \
--cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).