From: Jim Meyering <jim@meyering.net>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Theodore Tso <tytso@mit.edu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: efficient access to "rotational"; new fcntl?
Date: Sat, 19 Sep 2009 11:07:21 +0200 [thread overview]
Message-ID: <87k4zvpak6.fsf@meyering.net> (raw)
In-Reply-To: <20090919103149.54258081@infradead.org> (Arjan van de Ven's message of "Sat, 19 Sep 2009 10:31:49 +0200")
Arjan van de Ven wrote:
> On Sat, 19 Sep 2009 10:01:51 +0200
> Jim Meyering <jim@meyering.net> wrote:
>> Yeah, I mentioned I should do exactly that on IRC yesterday.
>> I've just run some tests, and see that at least with one SSD (OCZ
>> Summit 120GB), the 0.5s cost of sorting pays off handsomely with a
>> 12-x speed-up, saving 5.5 minutes, when removing a
>> 1-million-empty-file directory.
>>
>
> likely because you actually reduce the amount of IO; inodes share
> disk blocks; repeated unlinks in random order likely write the same
> block multiple times....
That makes sense.
Maybe cache effects, too?
> btw have you given thought about using threads as part of rm -r[f] ?
> (would make the unlinks of unrelated directories/files asynchronous)
While it is certainly a nicely parallelizable process,
rm usually runs so quickly that I doubt it'd be worthwhile.
If you know in advance that parallelizing a particular recursive
removal would give a significant benefit, it's probably best to do it
via e.g., xargs --max-procs=N.
However, sort *would* benefit, and some UCLA students implemented that
for a term project. Unfortunately, the project is stalled because the
implementation was not efficient enough, and no one has found the
time to improve it since.
next prev parent reply other threads:[~2009-09-19 9:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 19:31 efficient access to "rotational"; new fcntl? Jim Meyering
2009-09-18 22:16 ` Theodore Tso
2009-09-19 8:01 ` Jim Meyering
2009-09-19 8:31 ` Arjan van de Ven
2009-09-19 9:07 ` Jim Meyering [this message]
2009-09-19 9:19 ` Arjan van de Ven
2009-09-19 11:11 ` Avi Kivity
2009-09-19 11:30 ` Arjan van de Ven
2009-09-19 11:40 ` Avi Kivity
2009-09-19 11:25 ` Willy Tarreau
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=87k4zvpak6.fsf@meyering.net \
--to=jim@meyering.net \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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