Sujet : Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?
De : sfuld (at) *nospam* alumni.cmu.edu.invalid (Stephen Fuld)
Groupes : comp.archDate : 25. May 2025, 20:13:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <100vq44$1h5c4$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla Thunderbird
On 5/25/2025 11:05 AM, Waldek Hebisch wrote:
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> wrote:
On 5/23/2025 2:03 PM, Stefan Monnier wrote:
Stephen Fuld [2025-05-23 08:28:44] wrote:
On 5/22/2025 5:18 PM, Waldek Hebisch wrote:
It is pretty clear that due to drive mechanics track cache/buffer
is useful.
Pretty clear to everyone except one person. :-)
>
🙂
>
However, the real question is about size: how big
should it be. For "consumer" drives I see claims of 256 MB
cache. Given rather optimistic 200 MB/s transfer rate it is
about 1.25s of drive data, that is 80-150 rotations. I would
expect that say 4 tracks should be enough for reading. For
writing one could use few more tracks. Still, advertised cache
sizes seem to be much bigger than necessary.
It's not just the rotations, but the seek time. So your example is fewer
"operations" than the 80-150 you get when just including rotations.
>
I don't understand what you're getting at, here.
I think Waldek's argument is that 256MB corresponds approximately
to the amount of data stored in 80-150 tracks, and seek time doesn't
change that fact.
>
Yes, I didn't express myself well. :-( And once again, I have to say
that my information may be obsolete.
>
I think it is useful to separate talking about read data from write
data. For read data, as with any cache, more is always better than
less, though with diminishing returns. Why pick 1.25 sec as the "cut
off point"? If the host re-references data that it hasn't read for say
3 seconds, having it in cache still saves, probably a seek time and on
average 1/2 rotation time. Plus, it means the heads will be free to
handle other requests. All of this is standard cache benefits. I see
no reason to limit the cache size and reduce this benefit.
We are talking here about common case, that is when disc is accessed
via OS cache. OS cache is significantly larger than disc cache, so
hit ratio for data sent to host is going to be quite low. Disc
cache has an advantage: it gets "for free" some data that host did
not request. But it is rather unlikely that keeping such data
for long time has significant advantage.
And if you are caching writes, more cache gives you more blocks to choose
from when optimizing the write back order, which reduces the time to write
them all back.
>
IIUC, for SATA drives, NCQ is still limited to 32 in-flight commands, so
unless the drive is allowed to do write-back caching it seems the amount
of space used for write-buffering is likely small (compared to 256MB).
[ Unless it is common for individual write commands to cover multi-MB
chunks of data? ]
>
>
For write data, I was unaware of the 32 operation limit. I was used to
SCSI, which, IIRC was larger, and for server type applications, where
some sort of UPS is more common, the site may choose to enable write
caching in the disk. For a disk vendor, given the small cost of the
DRAM, it is an easy choice.
I do not look at details of disc protocol. But with protocal done
right host would first transfer commands and then deliver data
in order requested by the drive. So most buffering would be in
the host and disc would need just enough buffering to ensure
smooth transmission and low interrupt rate. 4 track looks like
plenty for this purpose.
No, when the disk receives a write command, it accepts the write data immediately (up to some large limit). That way, when the heads settle on the track, if the disk happens to be positioned in the middle of the transfer, it can write the last part of the data to the disk immediately, then wait for the disk to spin to where the transfer starts to finish the transferring the first part of the write data. This reduces average latency, i.e. improves performance.
The larger DRAM is a small component of drive cost, so the
manufacturers think it is worth including more.
>
In some markets (e.g. home routers), the size of DRAM seems to be enough
of a cost factor that it took many years until reaching 256MBs, even
though those boxes *need* that RAM for all kinds of purposes (the 128MB
of my current home-router seems to be its main source of instability).
but HDDs are pretty damn expensive beasts nowadays (because prices have
not gone down for the last 10 years or so), so I guess that makes
the relative cost of 512MB of DRAM "negligible"?
>
I can't comment on routers, but for disks, while the cost of the disk
may not have come down, increasing capacity allows reduced cost per
gigabyte. A substantial portion of the cost is not subject to Moore's
law (e.g. drive motor, magnets and arm assembly, etc.) and some capacity
increasing technologies cost more (but not enough more to overwhelm the
capacity advantage).
In nineties I read that for motherboard manufactures 1 cent was
"negligible", but 10 cents was significant: In volume transactions
margins were low and no party were willing to absorb 10 cents
per piece "loss". Discs probably are less competitive than
motherboards, but I would expect adding 256 MB to lead to 1
dollar or more increase of cost.
I can't comment on your specific numbers, but assuming you are right, adding $1 to the cost is is small, at least in the part of the market I was familiar with. And remember, you are not "adding" 256MB, as some of that is needed for various internal operations.
So IMO it is highly unclear why manufacturers use large caches.
One possible explanation could be benchmarketing and using
obsolete benchmarks.
Perhaps, but disk manufacturers are very sensitive to whatever benchmarks their customers use.
Another could be inertia with customers
thinking that "larger cache is better".
Sure.
Another things is fragmenting market into different "kinds" of
drives. Rationally, high performance drives should get
better mechanical parts. But in given performance area there
seem to be no reason for different mechanics, so I suspect
that they use the same. They may get different firmware.
"Green" consumer parts seem to be quite aggressive powering
down (IIUC on recent WD parts it is impossible to permanently
disable this), but beyond this it is not clear to me if there
are rational reasons for significantly different firmware.
My knowledge is too obsolete to know about any of these, but another possibility is more extensive burn in for more expensive drives.
-- - Stephen Fuld(e-mail address disguised to prevent spam)
Date | Sujet | # | | Auteur |
10 May 25 | Is Parallel Programming Hard, And, If So, What Can You Do About It? | 184 | | Thomas Koenig |
11 May 25 |  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 153 | | MitchAlsup1 |
11 May 25 |   Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 152 | | Al Kossow |
12 May 25 |    Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 151 | | Lawrence D'Oliveiro |
12 May 25 |     Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 150 | | MitchAlsup1 |
12 May 25 |      Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 149 | | Lawrence D'Oliveiro |
12 May 25 |       Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | MitchAlsup1 |
12 May 25 |        Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Lawrence D'Oliveiro |
12 May 25 |       Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 146 | | Terje Mathisen |
12 May 25 |        Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 3 | | Anton Ertl |
12 May 25 |         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Lawrence D'Oliveiro |
13 May 25 |         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
12 May 25 |        Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 142 | | Lawrence D'Oliveiro |
13 May 25 |         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | Stefan Monnier |
13 May 25 |          Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 3 | | Lawrence D'Oliveiro |
13 May 25 |           Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stefan Monnier |
13 May 25 |           Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
13 May 25 |         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 136 | | Anton Ertl |
13 May 25 |          Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 135 | | Lawrence D'Oliveiro |
13 May 25 |           Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 134 | | Stephen Fuld |
14 May 25 |            Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 61 | | Lawrence D'Oliveiro |
14 May 25 |             Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 58 | | Stephen Fuld |
18 May 25 |              Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 57 | | Lawrence D'Oliveiro |
19 May 25 |               Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 6 | | Lynn Wheeler |
19 May 25 |                Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 5 | | Vir Campestris |
19 May 25 |                 Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | Stephen Fuld |
20 May 25 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Vir Campestris |
21 May 25 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | Lynn Wheeler |
21 May 25 |                   Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
19 May 25 |               Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 50 | | MitchAlsup1 |
20 May 25 |                Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 49 | | MitchAlsup1 |
20 May 25 |                 Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 48 | | Lawrence D'Oliveiro |
20 May 25 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 47 | | BGB |
20 May 25 |                   Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 45 | | Stefan Monnier |
20 May 25 |                    Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | BGB |
20 May 25 |                     Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
21 May 25 |                    Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 42 | | Lawrence D'Oliveiro |
21 May 25 |                     Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 37 | | BGB |
21 May 25 |                      Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 36 | | Lawrence D'Oliveiro |
21 May 25 |                       Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 35 | | Stephen Fuld |
21 May 25 |                        Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 34 | | Anton Ertl |
22 May 25 |                         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 32 | | George Neuner |
22 May 25 |                          Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 31 | | BGB |
22 May13:12 |                           Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 30 | | Torbjorn Lindgren |
22 May18:39 |                            Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 29 | | BGB |
22 May23:41 |                             Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 28 | | Lawrence D'Oliveiro |
23 May00:36 |                              Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 27 | | BGB |
23 May15:21 |                               Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 24 | | John Levine |
23 May16:17 |                                Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 17 | | MitchAlsup1 |
23 May17:57 |                                 Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 16 | | Stephen Fuld |
23 May18:43 |                                  Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 15 | | MitchAlsup1 |
24 May01:26 |                                   Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 12 | | BGB |
24 May18:32 |                                    Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 11 | | BGB |
24 May21:36 |                                     Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | John Levine |
24 May22:45 |                                      Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 3 | | Michael S |
24 May22:54 |                                       Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | BGB |
26 May21:09 |                                        Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Terje Mathisen |
24 May22:07 |                                     Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | MitchAlsup1 |
24 May23:26 |                                      Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
25 May21:24 |                                     Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | Lars Poulsen |
25 May21:47 |                                      Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | John Levine |
25 May21:51 |                                      Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
26 May00:23 |                                      Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | MitchAlsup1 |
24 May23:17 |                                   Re: recycling | 2 | | Brian G. Lucas |
25 May07:24 |                                    Re: recycling | 1 | | George Neuner |
23 May16:53 |                                Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 6 | | BGB |
23 May18:34 |                                 Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 5 | | BGB |
24 May06:38 |                                  Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | BGB |
24 May17:57 |                                   Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | MitchAlsup1 |
24 May20:24 |                                    Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
24 May22:45 |                                   Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
23 May17:34 |                               Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | jseigh |
23 May17:39 |                                Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
22 May12:32 |                         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Dan Cross |
21 May 25 |                     Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | Stephen Fuld |
21 May 25 |                      Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 3 | | Lawrence D'Oliveiro |
21 May 25 |                       Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
21 May 25 |                       Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
21 May 25 |                   Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Lawrence D'Oliveiro |
14 May 25 |             Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | John Levine |
14 May 25 |              Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Thomas Koenig |
23 May01:18 |            Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 72 | | Waldek Hebisch |
23 May06:35 |             Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 5 | | Lawrence D'Oliveiro |
23 May07:09 |              Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 4 | | BGB |
23 May13:36 |               Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 3 | | MitchAlsup1 |
23 May17:29 |                Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | BGB |
24 May04:17 |                 Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Lawrence D'Oliveiro |
23 May16:28 |             Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 66 | | Stephen Fuld |
23 May22:03 |              Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 64 | | Stefan Monnier |
24 May17:23 |               Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 59 | | Stephen Fuld |
25 May19:05 |                Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 58 | | Waldek Hebisch |
25 May20:13 |                 Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 38 | | Stephen Fuld |
25 May20:36 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 27 | | MitchAlsup1 |
26 May05:23 |                   Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 26 | | Chris M. Thomasson |
26 May18:42 |                    Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 25 | | John Levine |
26 May19:16 |                     Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 24 | | Stephen Fuld |
26 May19:58 |                      Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 22 | | Stefan Monnier |
26 May20:19 |                       Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 20 | | John Levine |
27 May05:52 |                        Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 18 | | Stephen Fuld |
27 May09:34 |                         Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 17 | | Anton Ertl |
27 May15:34 |                          Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 16 | | Stephen Fuld |
28 May17:32 |                        Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stefan Monnier |
26 May21:36 |                       Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
26 May21:45 |                      Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Stephen Fuld |
26 May00:16 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 6 | | Stefan Monnier |
26 May08:13 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | Lawrence D'Oliveiro |
26 May20:20 |                  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 2 | | Waldek Hebisch |
25 May21:21 |                 Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | BGB |
26 May07:46 |                 Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 18 | | Anton Ertl |
25 May21:55 |               Drive Caches (Re: Is Parallel Programming Hard, ...) | 4 | | Lars Poulsen |
23 May23:19 |              Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Lawrence D'Oliveiro |
18 May 25 |         Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Lawrence D'Oliveiro |
19 May 25 |  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 29 | | quadibloc |
21 May 25 |  Re: Is Parallel Programming Hard, And, If So, What Can You Do About It? | 1 | | Chris M. Thomasson |