Instead of keeping several maps mapping back and forth from string to
entity_addr_t for each monitor, have the monitor's address and name in
purpose-specific class, mon_info_t, and everything references it
instead.
Although the benefits may not be obvious right now, it will allow us to
add other ip addresses for the monitors a bit more easily, instead of
having to kludge around the existing structures.
We also keep compatibility with older versions by maintaining the
traditional 'mon_addr' map. This is a logical change inside the monitor,
so we can easily accomodate older monitors without having to rely on
quorum features; just needs a bit of care and foo.
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
The compiler/linker guarantee this is initialized before any invocation
of this function... even if it is by a ctor in another compilation unit
that is initialized by the mempool.cc compilation unit.
Suggested by Bartłomiej Święcki <bartlomiej.swiecki@corp.ovh.com>
Signed-off-by: Allen Samuels <allen.samuels@sandisk.com>
e.g., mempool::bluestore_meta_other::list<...> ...
This avoids colliding with other names and types when the pool
name is something common (like "osd").
Signed-off-by: Sage Weil <sage@redhat.com>
# Conflicts:
# src/include/mempool.h
We want these to get their debug flag adjusted when it is turned
on and off.
(In contrast, we accept that STL containers will only be debugged
if mempool debug was on when they are constructed.)
Signed-off-by: Sage Weil <sage@redhat.com>
Assume that the array will be zeroed when the process starts, and
avoid the possibility that it will be zeroed *again* when the
ctors run for this link module (potentially clobbering values
that have been filled in by other ctors who ran earlier than
ours).
Signed-off-by: Sage Weil <sage@redhat.com>
This avoids having to use statics for the pool_allocators and
guessing what intenral types the containers are going to need.
It'll be a bit slower in debug on on construction and destruction,
but who cares!
Signed-off-by: Sage Weil <sage@redhat.com>
If we have a static choice of shard for every *type*
(pool_allocator_base_t) then we will hammer that shard from all
threads and play cacheline ping-pong. Instead, move the types
list to pool_t (there aren't that many anyway) and pick a shard
on every allocate/deallocate call.
Signed-off-by: Sage Weil <sage@redhat.com>
Trim cache based on overall memory utilization by cache objects,
as tracked by the bluestore_meta_* mempools. This lets you
configure the bluestore cache size in terms of bytes of memory.
Note that we do not account for other memory utilization by the
OSD.
Signed-off-by: Sage Weil <sage@redhat.com>
Keep onodes separate so we can use onodes as a sentinal for
overall memory usage (this is what we trim in terms of anyway).
Signed-off-by: Sage Weil <sage@redhat.com>