Why does writing to non-sequential lines in L2 perform so poorly?

By: Linus Torvalds (torvalds.delete@this.linux-foundation.org), December 22, 2017 12:20 pm
Room: Moderated Discussions
anon.1 (abc.delete@this.def.com) on December 21, 2017 5:09 pm wrote:
>
> Another hypothesis related to store ordering. When you store contiguous locations, the store buffer can
> combine them into one write to L1. So address A, A+4, A+8 can be combined assuming there were no coherence
> snoop on that line (this is part of the advantage of a store buffer). If you interleave it as A, B, A+4,
> B, x86 ordering rules no longer allow the stores to be observed out-of-order. So in the first case you
> likely never exhaust the store buffer whereas in the second case, you do.

I like this theory.

Yes. Doing writes to the same cacheline (or whatever the store buffer entry granularity is - it's likely the same width as the cache access width, rather than the cacheline width) allows you to just merge them in the same store buffer entry with a byte mask. So you're right, the first case has a much bigger effective store buffer.

That should be fairly easy for Travis to check - replace the L1 store with a store to another L2 line, and see the timing behavior remains.

Linus
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/20 01:44 PM
  Bridges? Wells? (NT)Micahel S2017/12/20 02:53 PM
    Bridges? Wells? (NT)Travis2017/12/20 03:46 PM
      That should say "huh"? (NT)Travis2017/12/20 03:46 PM
        That should say "huh"?Jeff S.2017/12/20 04:11 PM
          That should say "huh"?Travis2017/12/20 05:34 PM
    Bridges? Wells?Jeff S.2017/12/20 04:17 PM
      Bridges? Wells?Travis2017/12/20 05:37 PM
    Bridges, Wells - positiveMichael S2017/12/21 01:52 AM
      Bridges, Wells - positiveTravis2017/12/21 08:35 AM
        Bridges, Wells - positiveMichael S2017/12/21 09:00 AM
  Why does writing to non-sequential lines in L2 perform so poorly?Linus Torvalds2017/12/20 05:18 PM
    Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/20 05:54 PM
      Why does writing to non-sequential lines in L2 perform so poorly?Linus Torvalds2017/12/21 11:12 AM
        Why does writing to non-sequential lines in L2 perform so poorly?anon2017/12/22 02:29 AM
          Why does writing to non-sequential lines in L2 perform so poorly?Linus Torvalds2017/12/22 12:16 PM
            Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/23 07:48 PM
            Why does writing to non-sequential lines in L2 perform so poorly?Travis Downs2020/06/13 02:18 PM
              Why does writing to non-sequential lines in L2 perform so poorly?John D. McCalpin2020/06/18 11:50 AM
                Why does writing to non-sequential lines in L2 perform so poorly?Travis Downs2020/06/18 04:32 PM
                  Why does writing to non-sequential lines in L2 perform so poorly?Travis Downs2020/06/18 04:34 PM
    Why does writing to non-sequential lines in L2 perform so poorly?anon.12017/12/21 05:09 PM
      Why does writing to non-sequential lines in L2 perform so poorly?Linus Torvalds2017/12/22 12:20 PM
        Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/24 01:09 PM
  Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/20 07:52 PM
    Why does writing to non-sequential lines in L2 perform so poorly?Adrian2017/12/20 11:09 PM
      Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/21 08:23 AM
    Why does writing to non-sequential lines in L2 perform so poorly?-.-2017/12/27 02:53 AM
      Why does writing to non-sequential lines in L2 perform so poorly?-.-2017/12/27 02:53 AM
        Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/27 03:18 PM
  Why does writing to non-sequential lines in L2 perform so poorly?Etienne2017/12/21 01:36 AM
    Why does writing to non-sequential lines in L2 perform so poorly?Michael S2017/12/21 01:58 AM
      Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/21 08:26 AM
        Michael ignore my last question - saw your other reply (NT)Travis2017/12/21 08:27 AM
  Why does writing to non-sequential lines in L2 perform so poorly?Nksingg2017/12/26 05:47 AM
    Why does writing to non-sequential lines in L2 perform so poorly?David Kanter2017/12/26 10:48 AM
    Why does writing to non-sequential lines in L2 perform so poorly?Travis2017/12/27 03:33 PM
  Cannot reproduce with microcode 0xc6Travis Downs2019/02/26 03:23 PM
    Cannot reproduce with microcode 0xc6Adrian2019/02/26 08:35 PM
    Cannot reproduce with microcode 0xc6Adrian2019/02/26 09:07 PM
    Cannot reproduce with microcode 0xc6Adrian2019/02/27 04:02 AM
      Cannot reproduce with microcode 0xc6Travis Downs2019/02/27 07:25 AM
        Cannot reproduce with microcode 0xc6Adrian2019/02/28 12:16 AM
          Cannot reproduce with microcode 0xc6Travis Downs2019/03/07 05:51 PM
        Cannot reproduce with microcode 0xc6Adrian2019/02/28 08:54 AM
          Cannot reproduce with microcode 0xc6Travis Downs2019/03/24 05:34 PM
    Cannot reproduce with microcode 0xc6Travis Downs2019/02/27 02:20 PM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? ūüćä