Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?

Liste des GroupesRevenir à c arch 
Sujet : Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.arch
Date : 25. May 2025, 19:05:18
Autres entêtes
Organisation : To protect and to server
Message-ID : <100vm4s$16av3$1@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
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.

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.

So IMO it is highly unclear why manufacturers use large caches.
One possible explanation could be benchmarketing and using
obsolete benchmarks.  Another could be inertia with customers
thinking that "larger cache is better".

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.

--
                              Waldek Hebisch

Date Sujet#  Auteur
10 May 25 * Is Parallel Programming Hard, And, If So, What Can You Do About It?184Thomas Koenig
11 May 25 +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?153MitchAlsup1
11 May 25 i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?152Al Kossow
12 May 25 i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?151Lawrence D'Oliveiro
12 May 25 i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?150MitchAlsup1
12 May 25 i   `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?149Lawrence D'Oliveiro
12 May 25 i    +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2MitchAlsup1
12 May 25 i    i`- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Lawrence D'Oliveiro
12 May 25 i    `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?146Terje Mathisen
12 May 25 i     +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?3Anton Ertl
12 May 25 i     i+- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Lawrence D'Oliveiro
13 May 25 i     i`- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
12 May 25 i     `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?142Lawrence D'Oliveiro
13 May 25 i      +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?4Stefan Monnier
13 May 25 i      i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?3Lawrence D'Oliveiro
13 May 25 i      i +- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stefan Monnier
13 May 25 i      i `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
13 May 25 i      +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?136Anton Ertl
13 May 25 i      i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?135Lawrence D'Oliveiro
13 May 25 i      i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?134Stephen Fuld
14 May 25 i      i  +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?61Lawrence D'Oliveiro
14 May 25 i      i  i+* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?58Stephen Fuld
18 May 25 i      i  ii`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?57Lawrence D'Oliveiro
19 May 25 i      i  ii +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?6Lynn Wheeler
19 May 25 i      i  ii i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?5Vir Campestris
19 May 25 i      i  ii i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?4Stephen Fuld
20 May 25 i      i  ii i  +- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Vir Campestris
21 May 25 i      i  ii i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2Lynn Wheeler
21 May 25 i      i  ii i   `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
19 May 25 i      i  ii `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?50MitchAlsup1
20 May 25 i      i  ii  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?49MitchAlsup1
20 May 25 i      i  ii   `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?48Lawrence D'Oliveiro
20 May 25 i      i  ii    `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?47BGB
20 May 25 i      i  ii     +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?45Stefan Monnier
20 May 25 i      i  ii     i+* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2BGB
20 May 25 i      i  ii     ii`- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
21 May 25 i      i  ii     i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?42Lawrence D'Oliveiro
21 May 25 i      i  ii     i +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?37BGB
21 May 25 i      i  ii     i i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?36Lawrence D'Oliveiro
21 May 25 i      i  ii     i i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?35Stephen Fuld
21 May 25 i      i  ii     i i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?34Anton Ertl
22 May 25 i      i  ii     i i   +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?32George Neuner
22 May 25 i      i  ii     i i   i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?31BGB
22 May13:12 i      i  ii     i i   i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?30Torbjorn Lindgren
22 May18:39 i      i  ii     i i   i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?29BGB
22 May23:41 i      i  ii     i i   i   `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?28Lawrence D'Oliveiro
23 May00:36 i      i  ii     i i   i    `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?27BGB
23 May15:21 i      i  ii     i i   i     +* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?24John Levine
23 May16:17 i      i  ii     i i   i     i+* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?17MitchAlsup1
23 May17:57 i      i  ii     i i   i     ii`* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?16Stephen Fuld
23 May18:43 i      i  ii     i i   i     ii `* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?15MitchAlsup1
24 May01:26 i      i  ii     i i   i     ii  +* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?12BGB
24 May18:32 i      i  ii     i i   i     ii  i`* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?11BGB
24 May21:36 i      i  ii     i i   i     ii  i +* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?4John Levine
24 May22:45 i      i  ii     i i   i     ii  i i`* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?3Michael S
24 May22:54 i      i  ii     i i   i     ii  i i `* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?2BGB
26 May21:09 i      i  ii     i i   i     ii  i i  `- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1Terje Mathisen
24 May22:07 i      i  ii     i i   i     ii  i +* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?2MitchAlsup1
24 May23:26 i      i  ii     i i   i     ii  i i`- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
25 May21:24 i      i  ii     i i   i     ii  i `* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?4Lars Poulsen
25 May21:47 i      i  ii     i i   i     ii  i  +- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1John Levine
25 May21:51 i      i  ii     i i   i     ii  i  +- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
26 May00:23 i      i  ii     i i   i     ii  i  `- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1MitchAlsup1
24 May23:17 i      i  ii     i i   i     ii  `* Re: recycling2Brian G. Lucas
25 May07:24 i      i  ii     i i   i     ii   `- Re: recycling1George Neuner
23 May16:53 i      i  ii     i i   i     i`* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?6BGB
23 May18:34 i      i  ii     i i   i     i `* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?5BGB
24 May06:38 i      i  ii     i i   i     i  `* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?4BGB
24 May17:57 i      i  ii     i i   i     i   +* Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?2MitchAlsup1
24 May20:24 i      i  ii     i i   i     i   i`- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
24 May22:45 i      i  ii     i i   i     i   `- Re: the power of junk, Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
23 May17:34 i      i  ii     i i   i     `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2jseigh
23 May17:39 i      i  ii     i i   i      `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
22 May12:32 i      i  ii     i i   `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Dan Cross
21 May 25 i      i  ii     i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?4Stephen Fuld
21 May 25 i      i  ii     i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?3Lawrence D'Oliveiro
21 May 25 i      i  ii     i   +- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
21 May 25 i      i  ii     i   `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
21 May 25 i      i  ii     `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Lawrence D'Oliveiro
14 May 25 i      i  i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2John Levine
14 May 25 i      i  i `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Thomas Koenig
23 May01:18 i      i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?72Waldek Hebisch
23 May06:35 i      i   +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?5Lawrence D'Oliveiro
23 May07:09 i      i   i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?4BGB
23 May13:36 i      i   i `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?3MitchAlsup1
23 May17:29 i      i   i  `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2BGB
24 May04:17 i      i   i   `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Lawrence D'Oliveiro
23 May16:28 i      i   `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?66Stephen Fuld
23 May22:03 i      i    +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?64Stefan Monnier
24 May17:23 i      i    i+* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?59Stephen Fuld
25 May19:05 i      i    ii`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?58Waldek Hebisch
25 May20:13 i      i    ii +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?38Stephen Fuld
25 May20:36 i      i    ii i+* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?27MitchAlsup1
26 May05:23 i      i    ii ii`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?26Chris M. Thomasson
26 May18:42 i      i    ii ii `* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?25John Levine
26 May19:16 i      i    ii ii  `* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?24Stephen Fuld
26 May19:58 i      i    ii ii   +* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?22Stefan Monnier
26 May20:19 i      i    ii ii   i+* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?20John Levine
27 May05:52 i      i    ii ii   ii+* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?18Stephen Fuld
27 May09:34 i      i    ii ii   iii`* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?17Anton Ertl
27 May15:34 i      i    ii ii   iii `* Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?16Stephen Fuld
28 May17:32 i      i    ii ii   ii`- Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stefan Monnier
26 May21:36 i      i    ii ii   i`- Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
26 May21:45 i      i    ii ii   `- Re: fuzzy disks, Is Parallel Programming Hard, And, If So, What Can You Do About It?1Stephen Fuld
26 May00:16 i      i    ii i+* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?6Stefan Monnier
26 May08:13 i      i    ii i+* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2Lawrence D'Oliveiro
26 May20:20 i      i    ii i`* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?2Waldek Hebisch
25 May21:21 i      i    ii +- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1BGB
26 May07:46 i      i    ii `* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?18Anton Ertl
25 May21:55 i      i    i`* Drive Caches (Re: Is Parallel Programming Hard, ...)4Lars Poulsen
23 May23:19 i      i    `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Lawrence D'Oliveiro
18 May 25 i      `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Lawrence D'Oliveiro
19 May 25 +* Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?29quadibloc
21 May 25 `- Re: Is Parallel Programming Hard, And, If So, What Can You Do About It?1Chris M. Thomasson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal