History log of /6.6.0/kv_engine/engines/ep/src/atomic_unordered_map.h (Results 1 - 13 of 13)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v7.0.2, v6.6.3, v7.0.1, v7.0.0, v6.6.2, v6.5.2, v6.6.1, v6.0.5, v6.6.0, v6.5.1, v6.0.4, v6.5.0, v6.0.3, v5.5.4, v5.5.5, v5.5.6
# 2095a20b 18-Mar-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-30040: Use folly's cacheline padded

Change-Id: Icc1a112609da8dac979f07b6e02916278131270a
Reviewed-on: http://review.couchbase.org/106426
Tested-by: Build Bot <build@couchbase.com>

MB-30040: Use folly's cacheline padded

Change-Id: Icc1a112609da8dac979f07b6e02916278131270a
Reviewed-on: http://review.couchbase.org/106426
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...


# 04c1c8ec 20-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Remove config.h

Change-Id: I79eb8c762971255db9d36a5f6461a8a6d0f29249
Reviewed-on: http://review.couchbase.org/106517
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave

Remove config.h

Change-Id: I79eb8c762971255db9d36a5f6461a8a6d0f29249
Reviewed-on: http://review.couchbase.org/106517
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...


# 30b49081 29-Jan-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-32107: Reduce false sharing of cache lines in DcpProducer

Resolve the performance regression caused by changing the size of
ConnHandler and subsequently the DcpProducer. The change to

MB-32107: Reduce false sharing of cache lines in DcpProducer

Resolve the performance regression caused by changing the size of
ConnHandler and subsequently the DcpProducer. The change to the size of
ConnHandler shuffled DcpProducer class members around which caused the
unordered_map in StreamsMap to share a cache line with members in the
lock, and members in the lock of the StreamsMap to share a cache line
with following atomic variables in the DcpProducer. Resolve this issue
by cache line padding the mutex in the StreamsMap.

Perf testing was done against build 1553 and build 1558 of MadHatter.

Average results for runs:
1553 - 1973894 ops/s (8 runs)
1558 - 1923984 ops/s (8 runs)
Regressing Commit - 1938150 (5 runs)
(http://review.couchbase.org/#/c/101191/ - based on 1553)
This Commit - 1972524 (9 runs)
(based on 1553 + regressing commit)

Change-Id: I5d7b54e0a5f3348b7565a663993d56bc2165c300
Reviewed-on: http://review.couchbase.org/104193
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...


Revision tags: v6.0.1, v5.5.3
# 56d72278 11-Oct-2018 Jim Walker <jim@couchbase.com>

MB-31978: Use StreamContainer in DcpProducer

Change the DcpProducer map so that it now maps from vbid
to a shared_ptr<StreamContainer> however the StreamContainer
only stores a singl

MB-31978: Use StreamContainer in DcpProducer

Change the DcpProducer map so that it now maps from vbid
to a shared_ptr<StreamContainer> however the StreamContainer
only stores a single Stream.

This patch updates the DcpProducer code that relies on the streams
map to now lookup the value (shared_ptr<StreamContainer>) and then
use the StreamContainer iteration methods to locate the Stream
and complete there work, again only one stream is in the container,
but the code is now in-place for the creation of extra streams per
VB.

Change-Id: Idc9fc4de76eebf2b766dd37f08f7dd71065a3512
Reviewed-on: http://review.couchbase.org/101748
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Ben Huddleston <ben.huddleston@couchbase.com>

show more ...


Revision tags: v6.0.0
# 2998ae2e 10-Oct-2018 Jim Walker <jim@couchbase.com>

MB-31978: Add find_if2 to AtomicUnorderedMap

Add find_if2 which can return a value out of the
applied function opposed to find_if which returns the
value type.

Change-Id: I1

MB-31978: Add find_if2 to AtomicUnorderedMap

Add find_if2 which can return a value out of the
applied function opposed to find_if which returns the
value type.

Change-Id: I18eeb25db326a4d10e19b8c1084f9eb5473d16a3
Reviewed-on: http://review.couchbase.org/101747
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Ben Huddleston <ben.huddleston@couchbase.com>

show more ...


Revision tags: v5.1.3
# 364c798e 24-Sep-2018 Jim Walker <jim@couchbase.com>

MB-31390: [3/3] Update AtomicUnorderedMap to use read locking

For methods which don't change the map, use read locking.

Change-Id: If59176585c8c9447ac83f03b4bfc6c227104f4cc
Revi

MB-31390: [3/3] Update AtomicUnorderedMap to use read locking

For methods which don't change the map, use read locking.

Change-Id: If59176585c8c9447ac83f03b4bfc6c227104f4cc
Reviewed-on: http://review.couchbase.org/99883
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...


# a38de2ec 24-Sep-2018 Jim Walker <jim@couchbase.com>

MB-31390: [2/3] Add RWLock to AtomicUnorderedMap in write mode

Replace the std::mutex with a cb::RWLock and only use exclusive/write
mode.

Change-Id: Ie3bb93df0332736cb4aaac3f49

MB-31390: [2/3] Add RWLock to AtomicUnorderedMap in write mode

Replace the std::mutex with a cb::RWLock and only use exclusive/write
mode.

Change-Id: Ie3bb93df0332736cb4aaac3f49069355e42368f7
Reviewed-on: http://review.couchbase.org/99882
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...


# e46a34dd 24-Sep-2018 Jim Walker <jim@couchbase.com>

MB-31390: [1/3] clang-format atomic_unordered_map.h

Apply clang-format to entire file - no other changes.

Change-Id: I21e34ef411c374c8c48158adb0affde80cd93264
Reviewed-on: http:

MB-31390: [1/3] clang-format atomic_unordered_map.h

Apply clang-format to entire file - no other changes.

Change-Id: I21e34ef411c374c8c48158adb0affde80cd93264
Reviewed-on: http://review.couchbase.org/99885
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...


Revision tags: v5.5.2, v5.5.1, v5.1.2, v5.1.1
# dd5f2ca9 03-May-2018 Trond Norbye <trond.norbye@gmail.com>

Add empty() to atomic_unordered_map

That's a common method on maps

Change-Id: I99850636e1154feb5cbda5f7b5fa1f7419550730
Reviewed-on: http://review.couchbase.org/93709
Review

Add empty() to atomic_unordered_map

That's a common method on maps

Change-Id: I99850636e1154feb5cbda5f7b5fa1f7419550730
Reviewed-on: http://review.couchbase.org/93709
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...


Revision tags: v5.0.1, v5.1.0, v5.0.0
# ef22f9b0 25-May-2017 Dave Rigby <daver@couchbase.com>

Move ep-engine to engines/ep


Revision tags: v4.6.2_ep, v4.6.2_mc, v4.6.1_ep, v4.6.0_ep, v4.5.1-MP1_mc, v4.6.0-DP_mc, v4.6.0-DP_ep, v4.5.1-MP1_ep, v4.1.2-MP2_mc, v4.5.1_mc, v4.6.0_mc, v4.1.2-MP1_ep, v3.1.6_ep, v4.5.0_mc, v4.5.0_ep
# d91c6368 27-Apr-2016 Dave Rigby <daver@couchbase.com>

Change AtomicUnorderedMap to pass by value

AtomicUnorderedMap was initially written to wrap all returned values
in a templated smart pointer type. This meant that it always had
owner

Change AtomicUnorderedMap to pass by value

AtomicUnorderedMap was initially written to wrap all returned values
in a templated smart pointer type. This meant that it always had
ownership semantics. For the initial use-cases (DCP Consumer /
Producer maps) this was fine, however other use-cases may not want
ownership semantics, for example if a user holds a map of key -> raw
pointer type, and they can assume that the lifetime of the value type
outlives the map. Such a use-case could not previously use
AtomicUnorderedMap (as if you deleted the element it would potentially
destroy the object). Additionally, AtomicUnorderedMap couldn't be used
for simple value types where the overhead of smart pointer is
undesired (simple copying is fine).

Therefore modify the class to just hold the templated mapped_type
directly, deferring to the user if the value type happens to be a
pointer, smart or otherwise. All methods which previously returned a
PtrType now return a pair of {T, bool} where T is the value found (or
default-constructed if not found), and the bool denotes if T was
found. This is necessary as the null pointer type can no longer be
used to denote the absence of a value.

Change-Id: If82f10a3802d72eb3bf47f8d8b91d68c193cefdf
Reviewed-on: http://review.couchbase.org/63414
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Will Gardner <will.gardner@couchbase.com>

show more ...


# 6482aeca 26-Apr-2016 Will Gardner <will.gardner@couchbase.com>

MB-19374 Address datarace in AtomicUnorderedMap::size()

std::unordered_map::size() is not thread-safe unless other
threads are read-only.

WARNING: ThreadSanitizer: data race (pi

MB-19374 Address datarace in AtomicUnorderedMap::size()

std::unordered_map::size() is not thread-safe unless other
threads are read-only.

WARNING: ThreadSanitizer: data race (pid=131734)
Write of size 8 at 0x7d580002fc50 by thread T19 (mutexes: read M15526, write M20152):
#0 std::_Hashtable<unsigned short, std::pair<unsigned short const, SingleThreadedRCPtr<Stream> >, std::allocator<std::pair<unsigned short const, SingleThreadedRCPtr<Stream> > >, std::__detail::_Select1st, std::equal_to<unsigned short>, std::hash<unsigned short>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<unsigned short const, SingleThreadedRCPtr<Stream> >, false>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/hashtable.h:1625 (ep.so+0x000000069fa7)
#1 AtomicUnorderedMap<unsigned short, Stream, SingleThreadedRCPtr<Stream>, std::hash<unsigned short>, std::equal_to<unsigned short>, std::allocator<std::pair<unsigned short const, SingleThreadedRCPtr<Stream> > > >::insert(std::pair<unsigned short const, SingleThreadedRCPtr<Stream> > const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/hashtable.h:1724 (ep.so+0x0000000613e9)
#2 EvpDcpStreamReq(engine_interface*, void const*, unsigned int, unsigned int, unsigned short, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long*, ENGINE_ERROR_CODE (*)(vbucket_failover_t*, unsigned long, void const*)) /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-master/ep-engine/src/ep_engine.cc:1512 (ep.so+0x0000000b3737)

...

Previous read of size 8 at 0x7d580002fc50 by main thread (mutexes: write M14188, write M20259, write M14598):
#0 DcpProducer::addStats(void (*)(char const*, unsigned short, char const*, unsigned int, void const*), void const*) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/hashtable.h:500 (ep.so+0x0000000640f4)
#1 ConnStatBuilder::operator()(SingleThreadedRCPtr<ConnHandler>&) /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-master/ep-engine/src/ep_engine.cc:3859 (ep.so+0x0000000e02c1)
#2 EventuallyPersistentEngine::doDcpStats(void const*, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-master/ep-engine/src/ep_engine.cc:4116 (ep.so+0x0000000bf61a)

Change-Id: I139ca87ee1e4a1615f84ffc5318f577eee162106
Reviewed-on: http://review.couchbase.org/63363
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>

show more ...


Revision tags: v4.1.1_ep, v3.1.5_ep
# 186f81a5 11-Apr-2016 Dave Rigby <daver@couchbase.com>

MB-19184: Add AtomicUnorderedMap class & use for DcpProducer::streams

Create a new container class AtomicUnorderedMap. AtomicUnorderedMap is
a thread-safe unordered map (associative arra

MB-19184: Add AtomicUnorderedMap class & use for DcpProducer::streams

Create a new container class AtomicUnorderedMap. AtomicUnorderedMap is
a thread-safe unordered map (associative array). Elements can be
added, removed and found concurrently from different threads safely.

Update DcpProducer::streams to use the new class (instead of a vanilla
std::map + external locking).

Change-Id: Ibed2497551a8248a09f822b0a7167b9e801d20bd
Reviewed-on: http://review.couchbase.org/62653
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Will Gardner <will.gardner@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>

show more ...