All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] mongodb: Fix aarch64 build with gcc12
@ 2022-04-14 16:31 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2022-04-14 16:31 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...just-the-cache-alignment-assumptions.patch | 45 +++++++++++++++++++
 .../recipes-dbs/mongodb/mongodb_git.bb        |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch

diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch
new file mode 100644
index 0000000000..4b2a397b16
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-server-Adjust-the-cache-alignment-assumptions.patch
@@ -0,0 +1,45 @@
+From 5c9e0d0fc9188bab0ae09c9c33df01938b0c1b6c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Apr 2022 09:25:33 -0700
+Subject: [PATCH] server: Adjust the cache alignment assumptions
+
+aarch64 has 256 for hardware_destructive_interference_size and gcc 12
+has added a warning to complain about mismatches which results in
+static_assert failures
+
+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,
+     |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The structure need to ensure true sharing for both the elements
+so align it to hardware_constructive_interference_size instead
+
+Upstream-Status: Reported [https://jira.mongodb.org/browse/SERVER-65664]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mongo/db/stats/counters.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h
+index aa11c84c2f1..710d75a672f 100644
+--- a/src/mongo/db/stats/counters.h
++++ b/src/mongo/db/stats/counters.h
+@@ -178,10 +178,10 @@ private:
+     // These two counters are always incremented at the same time, so
+     // we place them on the same cache line.
+     struct Together {
+-        AtomicWord<long long> logicalBytesIn{0};
+-        AtomicWord<long long> requests{0};
++        alignas(std::hardware_constructive_interference_size) AtomicWord<long long> logicalBytesIn{0};
++        alignas(std::hardware_constructive_interference_size) AtomicWord<long long> requests{0};
+     };
+-    CacheAligned<Together> _together{};
++    Together _together{};
+     static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
+                   "cache line spill");
+ 
+-- 
+2.35.2
+
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
index 310a0aa38e..7ea728aad4 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb
@@ -31,6 +31,7 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://ppc64_ARCH_BITS.patch \
            file://PTHREAD_STACK_MIN.patch \
            file://0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch \
+           file://0001-server-Adjust-the-cache-alignment-assumptions.patch \
            "
 SRC_URI:append:libc-musl ="\
            file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
-- 
2.35.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-14 17:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 16:31 [meta-oe][PATCH] mongodb: Fix aarch64 build with gcc12 Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.