From: David Chinner <dgc@sgi.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: DS <xfs@bob.dscon.sk>, xfs@oss.sgi.com
Subject: Re: rewrite very slow
Date: Sat, 16 Feb 2008 13:46:34 +1100 [thread overview]
Message-ID: <20080216024634.GU155407@sgi.com> (raw)
In-Reply-To: <47B62FF6.2000903@sandeen.net>
On Fri, Feb 15, 2008 at 06:36:06PM -0600, Eric Sandeen wrote:
> DS wrote:
> > Hello,
> >
> > I need some help to tunning my storage.
>
> ...
> > TIME 43 sekund
>
>
> What kernel? when I test on my 2.6.23.9-85.fc8 and 2.6.22.5 boxes, I
> see 2 and 7 seconds for rewrite, respectively.
>
> but granted, on ext3 I get 0 seconds for every run.
>
> Also the difference appears to be O_TRUNC (which the perl script does);
> if I code it in c:
>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
>
> void main(void)
> {
> int i;
> int fd;
> char file[4];
>
> for (i = 0; i < 100; i++) {
> sprintf(file, "%d.txt", i);
> fd = open(file, O_CREAT|O_RDWR|O_TRUNC, 0644);
> write(fd, "aaaaaaaaaaaaaaaaaaa\n");
> close(fd);
> }
> }
>
> rewrite is a bit slower w/ O_TRUNC in place, plenty fast w/o it. Not
> sure about the xfs/ext3 difference... this is probably a side-effect of
> flushes xfs put into place on truncate (IIRC?)
Yup - after a truncate we use flush-on-close semantics if the file
is closed before pdflush does writeback. yes, it has a measurable
impact on silly microbenchmarks like this, but nobody even noticed
it when we introduced this code 2-3 years ago...
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2008-02-16 2:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-15 19:16 rewrite very slow DS
2008-02-16 0:36 ` Eric Sandeen
2008-02-16 2:46 ` David Chinner [this message]
2008-02-16 5:43 ` DS
2008-02-16 5:41 ` DS
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=20080216024634.GU155407@sgi.com \
--to=dgc@sgi.com \
--cc=sandeen@sandeen.net \
--cc=xfs@bob.dscon.sk \
--cc=xfs@oss.sgi.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.