Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65664

assumptions about hardware_constructive_interference_size and hardware_constructive_interference_size

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Dev Platform 2022-04-18, Dev Platform 2022-05-02, Dev Platform 2022-05-16

      GCC 12 has added a warning -Winterference-size when these are used without specifying its value. see 

      https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Winterference-size

       

      This is causing a build failure on aarch64 since hardware_constructive_interference_size defaults to 256 on this platform.

      we get error

       

      In file included from src/mongo/s/commands/cluster_find_cmd.cpp:39:
      src/mongo/db/stats/counters.h:185:47: error: static assertion failed: cache line spill
       185 |     static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
           |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      I think the assumption about these defaults are perhaps not right in mongodb, I also opened a gcc bug where there is some discussion around it.

       

      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105251

       

      perhaps 'struct Together' should be aligned to hardware_constructive_interference_size to promote true sharing and not to CacheAligned which is aligned to hardware_destructive_interference_size

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            raj.khem@gmail.com Khem Raj
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: