linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>,
	Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Grissiom <chaos.proton@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] async: Don't call async_synchronize_full_special() while holding sb_lock
Date: Mon, 12 Jan 2009 18:48:46 +1100	[thread overview]
Message-ID: <20090112074846.GJ8071@disturbed> (raw)
In-Reply-To: <20090112023138.GD6428@shareable.org>

On Mon, Jan 12, 2009 at 02:31:38AM +0000, Jamie Lokier wrote:
> Arjan van de Ven wrote:
> > >	- removing a million files and queuing all of the
> > >	  deletes in the async queues....
> > 
> > the async code throttles at 32k outstanding.
> > Yes 32K is arbitrary, but if you delete  a million files fast, all but the 
> > first few thousand are
> > synchronous.
> 
> Hmm.
> 
> If I call unlink() a thousand times and then call fsync() on the
> parent directories covering files I've unlinked... I expect the
> deletes to be committed to disk when the last fsync() has returned.  I
> require that a crash and restart will not see the files.  Several
> kinds of transactional software and even some shell scripts expect this.
> 
> Will these asynchronous deletes break the guaranteed
> commit-of-the-delete provided by fsync() on the parent directory?

It depends on the implementation of the filesystem you are running
on.

On XFS, it won't break anything because it uses a two-phase unlink.
The unlink() syscall removes the inode from the namespace
transactionally which means that even if you crash after the
directory fsync then they will never, ever appear in the directory
after recovery. In fact, recovery will see all those inodes as
existing on the unlinked lists and hence the execute the second
phase of the unlink during recovery.

I have no idea what the behaviour of other filesystems will
be but it needs to be evaluated on a filesystem-by-filesystem
basis.

Hmmmm. That introduces another interesting question w.r.t async
unlink in XFS - it's going to hammer the on-disk unlinked list hash
tables in XFS. The hashes are only 64 chains wide (per AG) so
pumping thousands of inodes into them is going to increase the
minimum memory footprint of XFS during rm -rf operations
substantially.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2009-01-12  7:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a0adeea50901080007q5a3ed5c8y5a744ce37e677325@mail.gmail.com>
2009-01-08 14:37 ` "BUG: scheduling while atomic: pdflush/30/0x00000002" in latest git Dave Kleikamp
2009-01-08 15:21   ` Arjan van de Ven
2009-01-08 15:46     ` [PATCH] async: Don't call async_synchronize_full_special() while holding sb_lock Dave Kleikamp
2009-01-08 22:50       ` Dave Chinner
2009-01-08 22:51         ` Arjan van de Ven
2009-01-09  0:32           ` Alan Cox
2009-01-09  0:38             ` Arjan van de Ven
2009-01-09  1:40           ` Dave Chinner
2009-01-09  4:45             ` Arjan van de Ven
2009-01-09  8:22               ` Dave Chinner
2009-01-09 15:09                 ` Chris Mason
2009-01-12  2:31               ` Jamie Lokier
2009-01-12  3:54                 ` Arjan van de Ven
2009-01-12  7:55                   ` Dave Chinner
2009-01-12  7:48                 ` Dave Chinner [this message]
2009-01-09 12:31         ` Evgeniy Polyakov
2009-01-09  5:18   ` "BUG: scheduling while atomic: pdflush/30/0x00000002" in latest git Grissiom

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=20090112074846.GJ8071@disturbed \
    --to=david@fromorbit.com \
    --cc=arjan@linux.intel.com \
    --cc=chaos.proton@gmail.com \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.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).