public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Dave Chinner <david@fromorbit.com>
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: Fri, 09 Jan 2009 10:09:29 -0500	[thread overview]
Message-ID: <1231513769.21333.17.camel@think.oraclecorp.com> (raw)
In-Reply-To: <20090109082250.GQ9448@disturbed>

On Fri, 2009-01-09 at 19:22 +1100, Dave Chinner wrote:
> >
> > 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.
> 
> No, after the first 32k you get a mix of synchronous and async as
> the async queue gets processed in parallel. This means you are
> screwing up the temporal locality of the unlink of inodes. i.e. some
> unlinks are being done immediately, others are being delayed until
> another 32k inodes have been processed of the unlink list.
>
>
> If we've been careful about allocation locality during untar so
> that inodes that are allocated sequentially by untar will be
> deleted sequential by rm -rf, then this new pattern will break those
> optimisations because the unlink locality is being broken by
> the some sync/some async behaviour that this queuing mechanism
> creates.
> 

You won't notice on ext34, but xfs, btrfs and probably jfs should go
slower with this.  The throttle should wait for one of the entries on
the queue to finish, and then put this inode on the  queue in order.
Doing the current one synchronously will generate random IO.

On XFS, create 256,000 4k files, drop caches and then time find . |
xargs rm

> Hmmmm - I suspect that rm -rf will also trigger lots of kernel
> threads to be created. We do not want 256 kernel threads to
> be spawned to bang on the serialised regions of filesystem
> journals (generating lock contention) when one thread would
> be sufficient....

This could be good and bad.

-chris



  reply	other threads:[~2009-01-09 15:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08  8:07 "BUG: scheduling while atomic: pdflush/30/0x00000002" in latest git Grissiom
2009-01-08 14:37 ` 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 [this message]
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
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=1231513769.21333.17.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=arjan@linux.intel.com \
    --cc=chaos.proton@gmail.com \
    --cc=david@fromorbit.com \
    --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