Danny Al-Gaaf [Tue, 30 May 2017 09:29:42 +0000 (11:29 +0200)]
common/Timer.h: ~SafeTimer needs to be virtual
Fix for:
CID 1396232 (#1 of 1): Non-virtual destructor (VIRTUAL_DTOR)
nonvirtual_dtor: Class librbd::<unnamed>::SafeTimerSingleton has a
destructor and a pointer to it is upcast to class SafeTimer which
doesn't have a virtual destructor.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Tue, 30 May 2017 08:56:23 +0000 (10:56 +0200)]
test_ipaddr.cc: memset with 0 and not '0'
Fix for:
CID 1405070 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405071 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405073 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405074 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405075 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405077 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405083 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405086 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
CID 1405087 (#1 of 1): Memset fill value of '0' (NO_EFFECT)
bad_memset: "memset" with fill value "'0'" (the zero character).
memset(&net, 48, 28UL). (CWE-665)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 11 May 2017 14:37:26 +0000 (16:37 +0200)]
client/MetaRequest.h: fix UNINIT_CTOR
Fix for:
CID 717207 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member dirp is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 11 May 2017 14:34:48 +0000 (16:34 +0200)]
client/Client.cc: fix UNINIT_CTOR
Fix for:
CID 1406088 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member root_ancestor is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 10 May 2017 14:52:54 +0000 (16:52 +0200)]
tools/rbd/Utils.cc: yank features_set_specified and related logic
since it isn't used
Fix for:
CID 1394854 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement:
opts->set(RBD_IMAGE_OPTION_....
Local variable features_set_specified is assigned only once, to a
constant value, making it effectively constant throughout its scope.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Adding Luminous release date, and dropping links for dev releases (since
they've been merged to 12.2.0), also rearranged the table so that newer
releases come left
xie xingguo [Thu, 31 Aug 2017 03:42:37 +0000 (11:42 +0800)]
os/bluestore: don't re-initialize csum-setting for existing blobs
The global checksum setting may change, e.g., from NONE to CRC32,
which can cause improper re-initialization of the csum-settings of
existing blobs(e.g., partial write/overwrite may turn out to shrink
'csum_data').
We could develop some complicated solutions but for now let's not
bother since the above scenario is rare.
Zac Medico [Thu, 31 Aug 2017 03:59:32 +0000 (20:59 -0700)]
interval_set: optimize intersection_of
Iterate over all elements of the smaller set, and use find_inc to
locate elements from the larger set in logarithmic time. This greatly
improves performance when one set is much larger than the other:
2 +-+--+----+----+----+----+----+----+----+----+--+-+
P +* +
E |* |
R 1.8 +* +
F | * |
O | * |
R 1.6 + * +
M | * |
A | * |
N 1.4 + * +
C | * |
E | * |
1.2 + * +
R | * |
A | * |
T 1 + *** +
I | ****** |
O + ***********************************
0.8 +-+--+----+----+----+----+----+----+----+----+--+-+
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
SET SIZE RATIO
The above plot compares performance of the new intersection_size_asym
function to the existing intersection_of function. The performance of
intersection_size_asym gets worse as the set size ratio approaches 1.
For set size ratios where the performance ratio is greater than 1, the
performance of intersection_size_asym is superior. Therefore, this
patch only uses intersection_size_asym when the set size ratio is less
than or equal to 0.1 (code uses the reciprocal which is 10).
The plot was generated using benchmark results produced by the
following program:
int main()
{
const int interval_count = 100000;
const int interval_distance = 4;
const int interval_size = 2;
const int sample_count = 8;
const int max_offset = interval_count * interval_distance;
interval_set<int> a, b, intersection;
for (int i = 0; i < max_offset; i+=interval_distance) {
a.insert(i, interval_size);
}
for (int m = 1; m < 100; m++) {
float ratio = 1 / float(m);
for (int i = 0; i < max_offset; i+=interval_distance*m) {
b.insert(i, interval_size);
}
struct timeb start, end;
int ms = 0;
for (int i = 0; i < sample_count; i++) {
ftime(&start);
intersection.intersection_of(a, b);
ftime(&end);
ms += (int) (1000.0 * (end.time - start.time)
+ (end.millitm - start.millitm));
intersection.clear();
}
b.clear();
std::cout << ratio << "\t" << ms << std::endl << std::flush;
}
}
Zac Medico [Sun, 27 Aug 2017 12:25:01 +0000 (05:25 -0700)]
interval_set: optimize intersect_of for identical spans
Optimize comparisons for identical spans of intervals.
When this patch is combined with the previous map insert
optimization, a benchmark using 400000 identical
intervals shows a 7 times performance improvement in
comparison to without the patches.
Use the std::map insert method with hint iterator to optimize
inserts. This increases performance more than 3.5 times for
large numbers of intervals. This will help performance
especially in the PGPool::update method, where profiling data
has shown that intersection operations are a hot spot. The
following benchmark data is for 400000 intervals:
4 +-+--+----+----+----+----+----+----+----+----+--+-+
P + + + + + + + + *************
E | ******** |
R 3.5 +-+ **** +-+
F | ****** |
O | ** |
R 3 +-+ **** +-+
M | *** |
A | ** |
N 2.5 +-+ * +-+
C | ** |
E | * |
2 +-+ ** +-+
R | ** |
A | ** |
T 1.5 +** +-+
I |** |
O +* + + + + + + + + + +
1 +*+--+----+----+----+----+----+----+----+----+--+-+
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
SET SIZE RATIO
The above chart was generated using benchmark results
from the following program:
Sage Weil [Tue, 29 Aug 2017 04:01:19 +0000 (00:01 -0400)]
mon: set purged_snapdirs OSDMap flag once snapsets have all converted
This makes it easier to test whether the upgrade + conversion has
completed. In particular, mimic+ will be able to simply test for this
flag without waiting for complete PG stats to know whether it is safe to
upgrade beyond luminous.
osd: add multiple objecter finishers
Bluestore and Filestore already adapt multiple finishers to improve IO performance.
But Objecter finisher (for tier approach) is still single thread. This can be a
bottleneck if we generate many IOs as Bluestore and Filestore because most of
completion processes (proxy, writeback) are handled by a objecter finisher.