Avoiding ping pong

By: anon (anon.delete@this.anon.com), December 4, 2014 10:15 am
Room: Moderated Discussions
Paul A. Clayton (paaronclayton.delete@this.gmail.com) on December 4, 2014 9:11 am wrote:
> anon (anon.delete@this.anon.com) on December 3, 2014 8:38 pm wrote:
> > Paul A. Clayton (paaronclayton.delete@this.gmail.com) on December 3, 2014 8:04 pm wrote:
> [snip]
> >> IBM's zSeries provides "constrained transactions" which are guaranteed to complete (no need for
> >> a fallback path) as long as certain conditions are met (including size of the code path).
> >>
> >> In theory simple atomic operations using ll/sc could
> be optimized through idiom recognition, but without an
> >> architectural guarantee a fallback path must be provided
> >> (though a simple always retry immediately mechanism
> >> would be valid and could work well even with a weaker guarantee than zSeries constrained transactions).
> >
> > Right. Power ISA provides for an architectural guarantee, although maybe it does not require
> > it of implementations. IBM's POWERx CPUs obviously guarantee it. I can't remember the
> > exact details and I don't have the ISA document handy, but indeed the requirement is a
> > strict limit on the number and types of instructions between the ll and the sc.
>
> Scanning through version 2.06 (Revision B) of the Power ISA, I did not find any constraints on
> ll/sc use (beyond same address and size; Alpha defined a minimum 16-byte lock range and it was
> unpredictable whether other memory accesses or taken branches would clear the lock_flag), but POWER
> might have specific constraints beyond those for the standard Power Server Environment.
>
> (Book II, Section 4.4, "Load and Reserve and Store Conditional Instructions", gives surprisingly
> little information, though it does mention the exclusivity hint, which can be used by hardware
> to distinguish between using ll/sc to set a lock (exclusive) and using ll/sc to update a shared
> variable that other threads are also likely to update with less regard for the value.)

There is the forward progress section. Although that is for system-wide forward progress. What I remember is that POWER CPUs also guarantee individual forward progress given particular restrictions on the critical section.

I can't find the reference yet.

> Anyway, I was referring more to positive architectural guarantees (e.g., the transaction will
> always succeed if there is only one fixed-point ALU instruction between the ll and the sc and
> the instruction sequence is within an aligned 32-byte (or instruction cache block sized) chunk,
> so fallback code would only be necessary for compatibility with older versions of the ISA).

I think "will always" is unnecessarily strict. Having an optimistic first pass allows a far less clever fallback. And unnecessary cleverness is something to be avoided :)

>
> I suspect POWER does not make even substantial negative guarantees, but is more like Alpha, declaring such
> to be unpredictable (so for a given implementation the circumstances could always clear the reservation,
> sometimes clear the reservation, or never clear the reservation). An implementation could exploit the fact
> that portable software will not use unpredictable behavior to more aggressively optimize certain cases,
> but much of that potential falls out from general practice of minimizing reservation duration.

Power ISA does not it seems, but it allows particular implementations to. POWER CPUs do. Software does actually make some assumptions about it too. Linux does not include "backoff" and livelock protection in its primitives (like e.g., compxchg based SPARC does).

>
> [snip]
>
> >> Even with side effects performance can be improved in some cases by performing operations remotely
> >> from the requester. Cache line ping pong can have a significant performance impact. Again, providing
> >> some guarantees could be useful (e.g., with certain guarantees about multiple threads "simultaneously"
> >> incrementing a counter, software could avoid hierarchical counters).
> >
> > I don't see why that would be. If you have to wait for a reply from remote before making progress,
> > it hardly matters whether that contains result of the operation or the data itself, does it?
>
> An example: Multiple threads incrementing a value to get a unique identifier would be serialized with communication
> delay in a traditional implementation (in addition to having more coherence traffic, which could be a performance
> constraint). With a centralized arbiter the communication delay is one round trip between core and arbiter
> rather than multiple serialized trips between different requesters and previous owners.
>
> (Perhaps I am missing something.)

Oh I see.

>
> (A perhaps better interface would allow each requester to ask for the response to be put in a
> mailbox since the result is probably not an immediate data dependency. I suppose such could be
> kludged in to existing systems by adding an undefined state for blocks of memory, so the

What's wrong with existing non blocking loads or OOOE mechanism or avoiding a stall?

The complexity would be in the cache coherency protocol and how to send it to the core. The difficulty I guess would be in providing it to that register only, as a one-shot deal.

requester
> would undefine a block, ask the arbiter/controller to write the response to that block, and hardware
> could treat a read of an undefined block something like a MWAIT instruction.)

< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
ARMv8 getting atomic operationsdmcq2014/12/02 05:32 PM
  ARMv8 getting atomic operationsMaynard Handley2014/12/02 07:33 PM
    ARMv8 getting atomic operationsDoug S2014/12/02 10:30 PM
      ARMv8 getting atomic operationsdmcq2014/12/03 03:16 AM
      ARMv8 getting atomic operationsMaynard Handley2014/12/03 09:20 AM
      ARMv8 getting atomic operationsBrett2014/12/03 04:46 PM
    ARMv8 getting atomic operationsAndreas2014/12/03 06:51 AM
      ARMv8 getting atomic operationsLinus Torvalds2014/12/03 11:15 AM
        ARMv8 getting atomic operationsanon2014/12/03 05:08 PM
          Guaranteed transactionsPaul A. Clayton2014/12/03 08:04 PM
            Guaranteed transactionsanon2014/12/03 08:38 PM
              Avoiding ping pongPaul A. Clayton2014/12/04 09:11 AM
                Avoiding ping ponganon2014/12/04 10:15 AM
                  OoO window is limitedPaul A. Clayton2014/12/04 01:06 PM
                Avoiding ping pongAaron Spink2014/12/04 12:01 PM
                  Avoiding ping pongKonrad Schwarz2014/12/04 01:10 PM
                    Avoiding ping pongAaron Spink2014/12/04 02:31 PM
                    Avoiding ping pongGabriele Svelto2014/12/04 02:49 PM
                      Avoiding ping pongKonrad Schwarz2014/12/04 11:08 PM
                        Avoiding ping pongGabriele Svelto2014/12/05 12:04 AM
                          Avoiding ping pongEric Bron nli2014/12/05 02:28 AM
                            Avoiding ping pongKonrad Schwarz2014/12/05 03:37 AM
                              Avoiding ping pongEric Bron nli2014/12/05 04:23 AM
                                Avoiding ping pongKlimax2014/12/05 05:47 AM
                                  Avoiding ping pongEric Bron2014/12/05 06:24 AM
                              Avoiding ping pongGabriele Svelto2014/12/05 10:38 AM
                                Avoiding ping pongKonrad Schwarz2014/12/07 02:28 PM
                                  Avoiding ping pongGabriele Svelto2014/12/08 07:10 PM
                                    Avoiding ping pongKonrad Schwarz2014/12/09 05:12 AM
                                      Avoiding ping pongGabriele Svelto2014/12/09 07:31 AM
                                        Avoiding ping ponganon2014/12/09 11:24 PM
                            Avoiding ping pongGabriele Svelto2014/12/05 10:17 AM
                              Avoiding ping pongEric Bron2014/12/05 10:32 AM
                                Avoiding ping pongGabriele Svelto2014/12/05 12:45 PM
                                  Avoiding ping pongEric Bron2014/12/06 02:20 AM
                                    Avoiding ping pongnksingh2014/12/06 03:42 AM
                                      Avoiding ping pongEric Bron2014/12/06 04:04 AM
                                        Avoiding ping pongGiGNiC2014/12/06 06:27 AM
                                          Avoiding ping pongEric Bron nli2014/12/06 06:44 AM
                                          Avoiding ping pongEric Bron2014/12/06 07:07 AM
                                            Avoiding ping pongnksingh2014/12/07 04:06 PM
                                              Avoiding ping pongEric Bron2014/12/08 04:17 AM
                                                Avoiding ping pongGiGNiC2014/12/08 11:53 AM
                                                Avoiding ping pongnksingh2014/12/08 05:53 PM
                                                  Avoiding ping pongEric Bron2014/12/09 01:33 AM
                                    Avoiding ping pongdmsc2014/12/06 04:12 AM
                                      Avoiding ping pongEric Bron2014/12/06 04:25 AM
                                        Avoiding ping pongKlimax2014/12/06 05:49 AM
                                          Avoiding ping pongrwessel2014/12/07 02:34 AM
                                        Avoiding ping pongdmsc2014/12/06 07:39 AM
                                        Avoiding ping pongKonrad Schwarz2014/12/07 02:37 PM
                                          Avoiding ping pongMichael S2014/12/07 04:37 PM
                                            Avoiding ping pongKonrad Schwarz2014/12/08 04:35 AM
                          Avoiding ping pongKonrad Schwarz2014/12/05 03:30 AM
                        Avoiding ping pongLinus Torvalds2014/12/05 12:58 PM
                          Avoiding ping pongEric Bron2014/12/06 02:42 AM
                            Avoiding ping pongnksingh2014/12/06 03:51 AM
                              Avoiding ping pongEric Bron2014/12/06 04:08 AM
                            Avoiding ping pongLinus Torvalds2014/12/06 01:25 PM
                              Avoiding ping pongnksingh2014/12/07 03:26 PM
                                Avoiding ping pongEric Bron2014/12/08 04:35 AM
                                  Avoiding ping pongBrett2014/12/08 10:00 AM
                                    Avoiding ping pongEric Bron2014/12/08 10:48 AM
                                    Avoiding ping pongrwessel2014/12/08 12:52 PM
                                      Avoiding ping pongBrett2014/12/08 01:58 PM
                                      Avoiding ping pongDoug S2014/12/08 02:04 PM
                              Avoiding ping pongJouni Osmala2014/12/08 02:45 AM
                                Avoiding ping ponganon2014/12/08 05:44 AM
                                  Avoiding ping pongJouni Osmala2014/12/08 01:10 PM
                                    Avoiding ping pongLinus Torvalds2014/12/08 01:34 PM
                                      Avoiding ping pongJouni Osmala2014/12/08 03:47 PM
                                        Avoiding ping pongLinus Torvalds2014/12/08 08:08 PM
                                          Avoiding ping pongGabriele Svelto2014/12/09 07:48 AM
                                            Avoiding ping pongMaynard Handley2014/12/09 11:41 AM
                                              Avoiding ping pongPatrick Chase2014/12/09 01:06 PM
                                              Avoiding ping pongGabriele Svelto2014/12/09 01:52 PM
                                                Avoiding ping pongPatrick Chase2014/12/09 02:08 PM
                                            Why read RWT or Reddit when you can get journalists to do it for you?Rob Thorpe2015/01/02 08:20 AM
                                              Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/02 11:21 AM
                                                Why read RWT or Reddit when you can get journalists to do it for you?EduardoS2015/01/02 11:37 AM
                                                  Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/03 12:00 PM
                                                Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron nli2015/01/02 02:28 PM
                                                  Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/03 12:02 PM
                                                    Why read RWT or Reddit when you can get journalists to do it for you?Michael S2015/01/03 12:36 PM
                                                      Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/03 01:11 PM
                                                        Why read RWT or Reddit when you can get journalists to do it for you?Michael S2015/01/03 01:30 PM
                                                          Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron2015/01/03 02:57 PM
                                                            KNL cacheDavid Kanter2015/01/03 07:36 PM
                                                              KNL cacheEric Bron2015/01/04 03:34 AM
                                                                KNL cacheMichael S2015/01/04 04:11 AM
                                                                  KNL cacheEric Bron2015/01/04 04:57 AM
                                                                    KNL cacheMichael S2015/01/04 05:21 AM
                                                                      KNL cacheEric Bron2015/01/04 05:58 AM
                                                          Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/07 05:47 AM
                                                            Why read RWT or Reddit when you can get journalists to do it for you?Michael S2015/01/07 08:27 AM
                                                              Manycores vs multicoresjuanrga2015/01/10 04:10 PM
                                                                Manycores vs multicoresAaron Spink2015/01/10 05:32 PM
                                                                  Manycores vs multicoresjuanrga2015/01/10 06:32 PM
                                                                    Manycores vs multicoresExophase2015/01/10 06:49 PM
                                                                      Manycores vs multicoresjuanrga2015/01/10 08:21 PM
                                                                        Manycores vs multicoresExophase2015/01/10 08:51 PM
                                                                        Manycores vs multicoresAaron Spink2015/01/10 09:03 PM
                                                                    Manycores vs multicoresAaron Spink2015/01/10 07:21 PM
                                                                      Manycores vs multicoresjuanrga2015/01/10 08:25 PM
                                                                        Manycores vs multicoresAaron Spink2015/01/10 09:11 PM
                                                                          Manycores vs multicoresJouni Osmala2015/01/11 04:50 AM
                                                                            Manycores vs multicoresjuanrga2015/01/11 08:58 AM
                                                                            Manycores vs multicorescoppice2015/01/12 10:01 PM
                                                                              Manycores vs multicoresJouni Osmala2015/01/13 04:38 AM
                                                                        Manycores vs multicoresanon2015/01/11 03:19 AM
                                                                      Manycores vs multicoresMichael S2015/01/11 05:44 AM
                                                                        Manycores vs multicoresAaron Spink2015/01/11 05:55 PM
                                                                          Manycores vs multicoresMichael S2015/01/12 04:41 AM
                                                                            Manycores vs multicoresEric Bron2015/01/12 06:29 AM
                                                                              Manycores vs multicoresEric Bron2015/01/12 06:30 AM
                                                        Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron2015/01/03 02:54 PM
                                                          Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/07 05:48 AM
                                                            Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron2015/01/07 07:41 AM
                                                              Manycores vs multicoresjuanrga2015/01/10 04:14 PM
                                                    Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron2015/01/03 02:42 PM
                                                      Why read RWT or Reddit when you can get journalists to do it for you?juanrga2015/01/07 06:03 AM
                                                        Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron2015/01/07 07:45 AM
                                                        Why read RWT or Reddit when you can get journalists to do it for you?Linus Torvalds2015/01/08 03:09 PM
                                                          Pink unicorns for salejuanrga2015/01/10 05:09 PM
                                                        Intentionally picking a competitors slow part is cheating ...Mark Roulo2015/01/08 06:37 PM
                                                          Intentionally picking a competitors slow part is cheating ...coppice2015/01/08 11:38 PM
                                                            Intentionally picking a competitors slow part is cheating ...Mark Roulo2015/01/09 09:13 AM
                                                              Intentionally picking a competitors slow part is cheating ...Anon2015/01/10 02:00 AM
                                                              Intentionally picking a competitors slow part is cheating ...David Hess2015/01/11 01:03 PM
                                                            Intentionally picking a competitors slow part is cheating ...someone2015/01/09 10:31 AM
                                                              Intentionally picking a competitors slow part is cheating ...coppice2015/01/12 09:45 PM
                                                                Intentionally picking a competitors slow part is cheating ...coppice2015/01/12 09:47 PM
                                                                  Intentionally picking a competitors slow part is cheating ...Michael S2015/01/13 07:53 AM
                                                                    Intentionally picking a competitors slow part is cheating ...coppice2015/01/13 09:44 AM
                                                                      Intentionally picking a competitors slow part is cheating ...Michael S2015/01/13 10:01 AM
                                                                        Intentionally picking a competitors slow part is cheating ...coppice2015/01/13 08:35 PM
                                                                      Core sizesjuanrga2015/01/13 12:28 PM
                                                          NVIDIA'S FIRST CPU IS A WINNER (Linley Gwennap)juanrga2015/01/10 04:34 PM
                                                        Why read RWT or Reddit when you can get journalists to do it for you?Patrick Chase2015/01/08 07:02 PM
                                                        Why read RWT or Reddit when you can get journalists to do it for you?coppice2015/01/08 10:18 PM
                                                          Why read RWT or Reddit when you can get journalists to do it for you?Patrick Chase2015/01/09 11:54 AM
                                                            Why read RWT or Reddit when you can get journalists to do it for you?Mark Roulo2015/01/09 12:59 PM
                                                              Why read RWT or Reddit when you can get journalists to do it for you?Patrick Chase2015/01/09 03:20 PM
                                                                Why read RWT or Reddit when you can get journalists to do it for you?Eric Bron2015/01/09 03:30 PM
                                                            Alternatives to OOOE (again)juanrga2015/01/10 04:50 PM
                                                              Alternatives to OOOE (again)David Kanter2015/01/11 12:10 AM
                                                                Alternatives to OOOE (again)juanrga2015/01/11 08:30 AM
                                                            Why read RWT or Reddit when you can get journalists to do it for you?Gabriele Svelto2015/01/11 12:53 AM
                                              Why read RWT or Reddit when you can get journalists to do it for you?Fake Linus Torvalds2015/01/03 12:14 PM
                                                Why read RWT or Reddit when you can get journalists to do it for you?Rob Thorpe2015/01/03 08:25 PM
                                          Avoiding ping pongMaynard Handley2014/12/09 11:33 AM
                                            Avoiding ping pongPatrick Chase2014/12/09 01:54 PM
                                              Avoiding ping pongMaynard Handley2014/12/09 06:56 PM
                                      Avoiding ping pongSalvatore De Dominicis2014/12/09 08:51 AM
                                        Avoiding ping pongPatrick Chase2014/12/09 02:00 PM
                                      Avoiding ping pongook2014/12/11 03:31 AM
                                      Avoiding ping pongArt Scott2014/12/19 10:19 PM
                                        Avoiding ping pongEric Bron nli2014/12/20 04:05 AM
                                      What about specialization?Troll?2015/01/02 07:55 AM
                                        What about specialization?Ungo2015/01/04 03:27 PM
                                      Avoiding ping pongfewwef2015/01/05 08:16 PM
                                      Avoiding ping pongV.Krishn2015/01/08 06:11 AM
                                    Avoiding ping pongGabriele Svelto2014/12/08 07:32 PM
                                    Avoiding ping ponganon2014/12/08 11:37 PM
                            Avoiding ping pongKonrad Schwarz2014/12/10 06:23 AM
                              Avoiding ping pongLinus Torvalds2014/12/10 11:56 AM
                          Object reference lockingDavid W2014/12/08 11:36 PM
                            Object reference lockingPatrick Chase2014/12/09 04:52 PM
                              Object reference lockingDavid W2014/12/11 05:18 AM
                    ISA != interface for "most programmers"Paul A. Clayton2014/12/04 03:34 PM
                      ISA != interface for "most programmers"rwessel2014/12/04 07:50 PM
                  Interesting! (exporting hot lines/cache-aware ISA); "Please sir, I want some more" (NT)Paul A. Clayton2014/12/04 02:26 PM
                  Avoiding ping pongMichael S2014/12/06 03:48 PM
          ARMv8 getting atomic operationsLinus Torvalds2014/12/04 12:05 PM
            LL/SC idiom recognition is not admitting RMW superiorityPaul A. Clayton2014/12/04 02:34 PM
            ARMv8 getting atomic operationsanon2014/12/04 10:17 PM
    ARMv8 getting atomic operationsPatrick Chase2014/12/03 12:09 PM
  limited ordernksingh2014/12/04 10:17 PM
    I didn't understand this either. (NT)Konrad Schwarz2014/12/04 10:32 PM
    limited orderdmcq2014/12/05 02:13 AM
    limited orderbakaneko2014/12/05 09:11 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? 🍊