Can anyone make sense of the following extract from a paper(pdf):

Compare and swap (casx): This instruction swaps the contents of one memory position allocated in the L2 data cache with the value of a register. This means that this instruction always accesses a memory location in L2 cache.

How (On Solaris, possibly only in assembler?) do you allocated a piece of memory such that "This means that this instruction always accesses a memory location in L2 cache.".

That is:

  1. How do you allocate memory "in the L2 cache"?

    There is no further explanation of this in the paper. They do however mention a pointer chasing arrangement to produce consistent L2 cache misses, which makes sense and suggests they know what they are talking about.

  2. How do you prevent it getting promoted to the L1 cache the first time it is accessed?

    Their very purpose in using the instruction is to benefit from the low-impact high-latency of an L1 cache miss. They further go on to say:

    Its latency is 39 cycles in T1 and between 20 and 30 cycles in T2 (in our experiments it takes almost always about 30 cycles). This instruction does not excessively stress the processor structures that could be used by the active thread. In fact, casx only uses one entry of the shared LSU structure that connects the core to the interconnection network. Moreover, the memory space requirements of using this instruction are very low since all the spin-locks can access the same memory position.

    Which makes it unlikely that the above is a slip of their tongues or otherwise a misinterpretation of their meaning.

I'm trying to work out how to apply their work on a Intel processor. The Perl link is another attempt at trying to make efficient shared memory available to from Perl.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to OT: Solaris expertise? by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.