From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Lionel Bouton <Lionel.Bouton@free.fr>, linux-kernel@vger.kernel.org
Subject: Re: File System Performance
Date: Mon, 12 Nov 2001 14:36:08 -0800 [thread overview]
Message-ID: <3BF04ED8.8A9280B5@zip.com.au> (raw)
In-Reply-To: <3BF04926.2080009@free.fr> <Pine.LNX.4.33.0111121411410.7555-100000@penguin.transmeta.com>
Linus Torvalds wrote:
>
> On Mon, 12 Nov 2001, Lionel Bouton wrote:
> >
> > Seems not the case with gnu tar : write isn't even called once on the fd
> > returned by open("/dev/null",...). In fact a "grep write" on the strace
> > output is empty in the "tar cf /dev/null" case. Every file in the tar-ed
> > tree is stat-ed but no-one is read-ed.
>
> Wow. What a sleazy optimization - it can't be anything but a special case.
>
> How do they do it anyway? By matching on the name Or by knowing what the
> minor/major numbers of /dev/null are supposed to be on that particular
> operating system?
/* Detect if outputting to "/dev/null". */
{
static char const dev_null[] = "/dev/null";
struct stat dev_null_stat;
dev_null_output =
(strcmp (archive_name_array[0], dev_null) == 0
|| (! _isrmt (archive)
&& stat (dev_null, &dev_null_stat) == 0
&& S_ISCHR (archive_stat.st_mode)
&& archive_stat.st_rdev == dev_null_stat.st_rdev));
}
> And what's the _point_ of the optimization? I've never heard of a "tar
> benchmark"..
Ask Al. He understands those GNU folks.
It's actually a bug. I may _want_ an ISREG /dev/null...
-
next prev parent reply other threads:[~2001-11-12 22:37 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-12 13:54 File System Performance Ben Israel
2001-11-12 16:33 ` Andrew Morton
2001-11-12 17:50 ` Ben Israel
2001-11-12 19:46 ` Andrew Morton
2001-11-12 19:59 ` Richard Gooch
2001-11-12 23:07 ` Mike Fedyk
2001-11-13 0:04 ` Richard Gooch
2001-11-13 0:08 ` Mike Fedyk
2001-11-13 0:26 ` Richard Gooch
2001-11-13 0:47 ` Mike Castle
2001-11-13 1:28 ` Mike Fedyk
2001-11-13 6:34 ` Richard Gooch
2001-11-13 20:56 ` Andreas Dilger
2001-11-13 7:45 ` Andreas Dilger
2001-11-12 20:06 ` Steve Lord
2001-11-12 20:41 ` Andrew Morton
2001-11-12 21:27 ` Steve Lord
2001-11-12 21:43 ` Andrew Morton
2001-11-12 21:45 ` Steve Lord
2001-11-12 21:48 ` Linus Torvalds
2001-11-12 22:11 ` Lionel Bouton
2001-11-12 19:41 ` Gérard Roudier
2001-11-12 22:14 ` Linus Torvalds
2001-11-12 22:30 ` Ragnar Kjørstad
2001-11-12 22:36 ` Andrew Morton [this message]
2001-11-12 23:04 ` Mike Castle
2001-11-13 9:56 ` Peter Wächtler
2001-11-13 9:41 ` Henning P. Schmiedehausen
2001-11-12 22:16 ` Andrew Morton
2001-11-12 22:26 ` Steve Lord
2001-11-12 22:32 ` Lionel Bouton
2001-11-12 22:45 ` Alan Cox
2001-11-12 22:39 ` Alan Cox
2001-11-12 22:39 ` Xavier Bestel
2001-11-12 22:46 ` Mike Castle
2001-11-12 21:53 ` Lionel Bouton
2001-11-13 0:17 ` Andreas Dilger
2001-11-13 0:40 ` Peter J . Braam
2001-11-13 20:46 ` Andreas Dilger
2001-11-16 22:07 ` Peter J . Braam
2001-11-16 23:14 ` Mike Fedyk
2001-11-12 16:40 ` Ben Israel
2001-11-12 17:29 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2001-11-12 22:36 Grant Erickson
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=3BF04ED8.8A9280B5@zip.com.au \
--to=akpm@zip.com.au \
--cc=Lionel.Bouton@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.