From: Jonathan Morton <chromi@cyberspace.org>
To: Rik van Riel <riel@conectiva.com.br>
Cc: Andre Hedrick <andre@linux-ide.org>,
Linus Torvalds <torvalds@transmeta.com>,
Jeremy Hansen <jeremy@xxedgexx.com>,
linux-kernel@vger.kernel.org
Subject: Re: scsi vs ide performance on fsync's
Date: Tue, 6 Mar 2001 14:08:27 +0000 [thread overview]
Message-ID: <l0313030db6ca9bf216b9@[192.168.239.101]> (raw)
In-Reply-To: <Pine.LNX.4.21.0103060920320.5591-100000@imladris.rielhome.conectiva>
In-Reply-To: <l0313030ab6ca4912a397@[192.168.239.101]>
>> Pathological shutdown pattern: assuming scatter-gather is not allowed (for
>> IDE), and a 20ms full-stroke seek, write sectors at alternately opposite
>> ends of the disk, working inwards until the buffer is full. 512-byte
>> sectors, 2MB of them, is 4000 writes * 20ms = around 80 seconds (not
>> including rotational delay, either). Last time I checked, you'd need a
>> capacitor array the size of the entire computer case to store enough power
>> to allow the drive to do this after system shutdown, and I don't remember
>> seeing LiIon batteries strapped to the bottom of my HDs. Admittedly, any
>> sane OS doesn't actually use that kind of write pattern on shutdown, but
>> the drive can't assume that.
>
>But since the drive has everything in cache, it can just write
>out both bunches of sectors in an order which minimises disk
>seek time ...
>
>(yes, the drives don't guarantee write ordering either, but that
>shouldn't come as a big surprise when they don't guarantee that
>data makes it to disk ;))
That would be true for SCSI devices - I understand the controllers and/or
drives support "scatter-gather" which allows a drive to optimise it's seek
pattern in the manner you describe. However, I'm not sure whether an IDE
drive is allowed to do this. I'm reasonably sure that I heard somewhere
that IDE drives have to complete transactions in the specified order as far
as the host is concerned - what I'm unsure of is whether this also applies
to mechanical head movement.
If not, then the drive could by all means optimise the access pattern
provided it acked the data or provided the results in the same order as the
instructions were given. This would probably shorten the time for a new
pathological set (distributed evenly across the disk surface, but all on
the worst-possible angular offset compared to the previous) to (8ms seek
time + 5ms rotational delay) * 4000 writes ~= 52 seconds (compared with
around 120 seconds for the previous set with rotational delay factored in).
Great, so you only need half as big a power store to guarantee writing that
much data, but it's still too much. Even with a 15000rpm drive and 5ms
seek times, it would still be too much.
The OS needs to know the physical act of writing data has finished before
it tells the m/board to cut the power - period. Pathological data sets
included - they are the worst case which every engineer must take into
account. Out of interest, does Linux guarantee this, in the light of what
we've uncovered? If so, perhaps it could use the same technique to fix
fdatasync() and family...
--------------------------------------------------------------
from: Jonathan "Chromatix" Morton
mail: chromi@cyberspace.org (not for attachments)
big-mail: chromatix@penguinpowered.com
uni-mail: j.d.morton@lancaster.ac.uk
The key to knowledge is not to rely on people to teach you it.
Get VNC Server for Macintosh from http://www.chromatix.uklinux.net/vnc/
-----BEGIN GEEK CODE BLOCK-----
Version 3.12
GCS$/E/S dpu(!) s:- a20 C+++ UL++ P L+++ E W+ N- o? K? w--- O-- M++$ V? PS
PE- Y+ PGP++ t- 5- X- R !tv b++ DI+++ D G e+ h+ r- y+
-----END GEEK CODE BLOCK-----
next prev parent reply other threads:[~2001-03-06 14:10 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-02 17:42 Jeremy Hansen
2001-03-02 18:39 ` Steve Lord
2001-03-02 19:17 ` Chris Mason
2001-03-02 19:25 ` Steve Lord
2001-03-02 19:27 ` Jeremy Hansen
2001-03-02 19:38 ` Chris Mason
2001-03-02 19:41 ` Steve Lord
2001-03-05 13:23 ` Andi Kleen
2001-03-02 19:25 ` Andre Hedrick
2001-03-03 1:55 ` Dan Hollis
2001-03-02 20:56 ` Linus Torvalds
2001-03-06 2:13 ` Jeremy Hansen
2001-03-06 2:25 ` Linus Torvalds
2001-03-06 3:30 ` Jonathan Morton
2001-03-06 4:05 ` Linus Torvalds
2001-03-06 7:03 ` Andre Hedrick
2001-03-06 8:24 ` Jonathan Morton
2001-03-06 12:22 ` Rik van Riel
2001-03-06 14:08 ` Jonathan Morton [this message]
2001-03-07 16:50 ` Pavel Machek
2001-03-06 19:41 ` Andre Hedrick
2001-03-07 5:25 ` Jonathan Morton
2001-03-07 6:58 ` Andre Hedrick
2001-03-09 11:39 ` Jonathan Morton
[not found] <Pine.LNX.4.33L2.0103021033190.6176-200000@srv2.ecropolis.com>
[not found] ` <054201c0a33d$55ee5870$e1de11cc@csihq.com>
2001-03-04 20:10 ` Douglas Gilbert
2001-03-04 21:28 ` Ishikawa
2001-03-06 0:11 ` Douglas Gilbert
2001-03-06 5:27 Douglas Gilbert
2001-03-06 5:45 ` Linus Torvalds
2001-03-06 7:12 ` Andre Hedrick
2001-03-06 12:09 ` Alan Cox
2001-03-06 18:44 ` Linus Torvalds
2001-03-07 13:48 ` Stephen C. Tweedie
2001-03-07 14:13 ` Jens Axboe
2001-03-12 18:50 ` Andre Hedrick
2001-03-06 13:50 ` Mike Black
2001-03-06 16:02 ` Jeremy Hansen
2001-03-07 18:27 ` Jeremy Hansen
2001-03-07 18:36 ` Linus Torvalds
2001-03-08 11:06 ` Stephen C. Tweedie
2001-03-06 16:57 ` Jonathan Morton
2001-03-06 6:43 ` Jonathan Morton
2001-03-06 13:03 ` dean gaudet
2001-03-06 13:15 ` dean gaudet
2001-03-06 13:45 ` Jonathan Morton
2001-03-06 17:14 David Balazic
2001-03-06 17:46 ` Gregory Maxwell
2001-03-06 18:23 ` Jonathan Morton
2001-03-06 23:27 ` Mark Hahn
2001-03-06 19:42 David Balazic
2001-03-06 20:37 ` Jens Axboe
2001-03-07 13:51 ` Stephen C. Tweedie
2001-03-07 14:12 ` Jens Axboe
2001-03-07 15:05 ` Stephen C. Tweedie
2001-03-07 18:51 ` Jens Axboe
2001-03-07 19:10 ` Stephen C. Tweedie
2001-03-07 20:15 ` Jens Axboe
2001-03-07 20:56 ` Stephen C. Tweedie
2001-03-07 20:59 ` Jens Axboe
2001-03-08 15:45 ` Chris Mason
2001-03-07 12:47 David Balazic
[not found] <1epyyz1.etswlv1kmicnqM%smurf@noris.de>
2001-03-09 6:59 ` Matthias Urlichs
2001-03-09 11:51 ` Jens Axboe
2001-03-09 14:26 ` Matthias Urlichs
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='l0313030db6ca9bf216b9@[192.168.239.101]' \
--to=chromi@cyberspace.org \
--cc=andre@linux-ide.org \
--cc=jeremy@xxedgexx.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@conectiva.com.br \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®