public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Matti Aarnio <matti.aarnio@zmailer.org>,
	Morten Welinder <mwelinder@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Deleting large files
Date: Sun, 11 May 2008 22:12:14 +0530	[thread overview]
Message-ID: <20080511164214.GA8091@skywalker> (raw)
In-Reply-To: <20080511111652.GA2323@infradead.org>

On Sun, May 11, 2008 at 07:16:53AM -0400, Christoph Hellwig wrote:
> On Thu, May 08, 2008 at 11:19:06AM +0300, Matti Aarnio wrote:
> > This very question has troubled SQUID developers.  Whatever the system, unlink()
> > that really does free diskspace does so with unbound timelimit and in services
> > where one millisecond is long wait time, the solution has been to run separate
> > subprocess that actually does the unlinks.
> > 
> > Squid is not threaded software, and it was created long ago when threads were
> > rare and implementations were different in subtle details --> no threads at all.
> 
> I'd call long times for the final unlink a bug in the filesystem.
> There's not all that much to do when deleting a file.   What you need to
> do is basically return the allocated space to the free space allocator
> and mark the inode as unused and return it to the inode allocator.  The
> first one may take quite a while with a indirect block scheme, but with
> an extent based filesystem it shouldn't be a problem.  The latter
> shouldn't take too long either, and with a journaling filesystem it's
> even easier because you can intent-log the inode deletion first and then
> perform it later e.g. as part of a batched write-back of the inode
> cluster.

The problem with journalling file system like ext3 is that the credits
available in the journal may not be sufficient for full truncate. In
that case we will have to commit the journal. And that means we will
have to zero fill some of the indirect blocks so that when the
transaction is committed the inode format is a valid one.

For ext3 there are patches from abhishek that actually speed up
meta-data intensive operation. Eric Sandeen did some measurements
here.

http://people.redhat.com/esandeen/rm_test/

I have patches for Ext4 based on top of the new block allocator for
Ext4. There is some improvment with Ext3 mode.

http://www.radian.org/~kvaneesh/ext4/meta-group/

-aneesh

  reply	other threads:[~2008-05-11 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 19:49 Deleting large files Morten Welinder
2008-05-07 20:10 ` Jan Engelhardt
2008-05-07 20:17   ` Xavier Bestel
2008-05-07 20:48     ` Jan Engelhardt
2008-05-07 22:34 ` linux-os (Dick Johnson)
2008-05-07 23:14   ` Morten Welinder
2008-05-08 23:01     ` Alan Cox
2008-05-11 10:30     ` Jan Engelhardt
2008-05-11 16:38       ` Enrico Weigelt
2008-05-20 14:33     ` Pavel Machek
2008-05-08  8:19 ` Matti Aarnio
2008-05-11 11:16   ` Christoph Hellwig
2008-05-11 16:42     ` Aneesh Kumar K.V [this message]
2008-05-08 17:29 ` Christian Kujau
     [not found]   ` <118833cc0805081110u7aad3921v3a1ec4187acc4ef4@mail.gmail.com>
2008-05-08 18:54     ` Christian Kujau
2008-05-17 12:15 ` Pavel Machek

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=20080511164214.GA8091@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.aarnio@zmailer.org \
    --cc=mwelinder@gmail.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