]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/mempool: Modify shard selection function 39977/head
authorAdam Kupczyk <akupczyk@redhat.com>
Mon, 25 Jan 2021 10:45:06 +0000 (11:45 +0100)
committersinguliere <singuliere@autistici.org>
Tue, 9 Mar 2021 23:57:33 +0000 (00:57 +0100)
Modify shard selection function, so no longer all threads use the same shard 0.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit fccbdc0905e3868666fbb10803bac6b73f687cb1)

src/include/mempool.h

index a18f6a502daad3f65156beae5b922fae02c980d2..c03aa175cfa07ef4c1acb5206cd8152322d6221d 100644 (file)
@@ -259,7 +259,7 @@ public:
     // Dirt cheap, see:
     //   https://fossies.org/dox/glibc-2.32/pthread__self_8c_source.html
     size_t me = (size_t)pthread_self();
-    size_t i = (me >> 3) & ((1 << num_shard_bits) - 1);
+    size_t i = (me >> 12) & ((1 << num_shard_bits) - 1);
     return i;
   }