From: Jan Kara <jack@suse.cz>
To: "Jörn Engel" <joern@logfs.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Good place to drop preallocation on directories
Date: Thu, 20 Nov 2008 14:10:28 +0100 [thread overview]
Message-ID: <20081120131028.GB20118@duck.suse.cz> (raw)
In-Reply-To: <20081120110555.GA30887@logfs.org>
On Thu 20-11-08 12:05:55, Jörn Engel wrote:
> On Wed, 19 November 2008 21:32:42 +0100, Jan Kara wrote:
> >
> > I have a problem in UDF so I thought I'll post it here if someone has a
> > good idea how to solve it.
> > UDF does preallocation on directories (on files a well, but that is not a
> > problem). Now this helps against directory fragmentation but there is an
> > issue with it: When to drop this preallocation? Currently it is done in
> > udf_clear_inode() which has two problems:
> > 1) udf_clear_inode() is really called to late to do anything like freeing
> > space from inode and UDF has to play some nasty tricks (like
> > explicitely syncing inode, calling invalidate_inode_buffers() once
> > more) to make everything work. Using udf_drop_inode() would be much
> > better but that is called under i_lock so it's not really usable
> > (unless I'd drop i_lock in it but then it would even nastier).
> > 2) When you create lots of directories, they use quite some additional
> > space for preallocation and there's not really a got way how to get rid
> > of preallocated blocks than dropping dcache or umount + mount the
> > filesystem.
> >
> > So after all I'm thinking whether directory preallocation is really worth
> > the trouble. But before I go and rip it I'd like to check whether someone
> > does not have some clever idea :).
>
> Problem 2 has lru written all over, don't you think? Problem 1 is
> similar to something I'm debugging this very moment. With some luck my
> solution might work for you as well.
Hmm, yes, I was thinking of implementing something like LRU. I just
thought it might be a bit overkill. But maybe not...
> However, I don't see a big difference between files and directories yet.
> Maybe because there shouldn't be, or maybe because I've been missing
> something critical. Could you elaborate on that?
For files I use ->release() callback to drop preallocation. So
preallocation is dropped on last close of a file which is not completely
optimal but generally good enough.
Thanks for your ideas.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2008-11-20 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-19 20:32 Good place to drop preallocation on directories Jan Kara
2008-11-20 11:05 ` Jörn Engel
2008-11-20 13:10 ` Jan Kara [this message]
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=20081120131028.GB20118@duck.suse.cz \
--to=jack@suse.cz \
--cc=joern@logfs.org \
--cc=linux-fsdevel@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).