]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/mempool: Modify shard selection function
authorAdam Kupczyk <akupczyk@redhat.com>
Mon, 25 Jan 2021 10:45:06 +0000 (11:45 +0100)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Feb 2021 21:05:57 +0000 (22:05 +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 c4b0086c106c0500756055063121ea66db1d132b..9cee38256ea6637132c8a947715dd72451d479b6 100644 (file)
@@ -258,7 +258,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;
   }