os/bluestore: make assert conditional with macro for allocator#11014
os/bluestore: make assert conditional with macro for allocator#11014liewegas merged 2 commits intoceph:masterfrom
Conversation
src/os/bluestore/BitAllocator.h
Outdated
|
|
||
| static inline void noop(bool var) | ||
| { | ||
| } |
There was a problem hiding this comment.
This might not get optimized out. Better to do a simple
#define alloc_dbg_assert(x)
There was a problem hiding this comment.
Actually system assert.h does
#if defined __cplusplus && __GNUC_PREREQ (2,95) # define __ASSERT_VOID_CAST static_cast<void> #else # define __ASSERT_VOID_CAST (void) #endif # define assert(expr) (__ASSERT_VOID_CAST (0))
which is probably a bit better.
There was a problem hiding this comment.
@liewegas , changed dummy function to what you suggested from assert.h. Please have a look now. I also wanted to define this macro BIT_ALLOCATOR_DEBUG for test case compilation but could not make it work :(.
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
6eaae6d to
de7cbf4
Compare
src/os/bluestore/BlueStore.cc
Outdated
| if (min_min_alloc_size > 0) { | ||
| derr << "warning: bluestore_min_alloc_size value decreased from " | ||
| << min_min_alloc_size << " to " << new_val << "." | ||
| << " Decreased value could have perofrmanc impact." << dendl; |
2d652db to
284f4d7
Compare
| // Min min_alloc_size | ||
| { | ||
| bufferlist bl; | ||
| min_min_alloc_size = 0; |
There was a problem hiding this comment.
= min_alloc_size
for base case (after mkfs). or when someone upgrades.
There was a problem hiding this comment.
It is always set after call to _save_min_min_alloc_size. Taking value 0 as argument to this function identifies the condition where we always need to save the min_min_alloc_size.
The min_alloc_size is set before call to this function. So the cases:
- min_min_alloc_size : 0, then we need to save current min_alloc_size as min_min_alloc_size. That handles upgrade and mkfs cases where there is no older value.
- min_min_alloc_size < min_alloc_size, we need to put message and do nothing in this case.
- min_min_alloc_size > min_alloc_size, we need to put message and save new value.
In all cases at end of this function, min_min_alloc_size == min_alloc_size.
I think it handles all cases ?
6f0b0aa to
f82b320
Compare
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
f82b320 to
24538e4
Compare
|
@liewegas , a gentle reminder to have a look now and merge if looks ok. |
Change makes the is_allocated related code conditional with a macro.
Rest of code split with different assert so that basic check are still performed.
Signed-off-by: Ramesh Chander Ramesh.Chander@sandisk.com