]>
git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: avoid unneeded BlobRefing in _do_read().
The hottest place in the terms of CPU cycles according to `perf annotate`:
```
| intrusive_ptr(intrusive_ptr const & rhs): px( rhs.px )
0,04 | 365: mov 0x28(%rax),%r12
| {
| if( px != 0 ) intrusive_ptr_add_ref( px );
0,41 | test %r12,%r12
| ↓ je 37c
| _ZNSt13__atomic_baseIiEppEv():
0,04 | lock addl $0x1,(%r12)
19,75 | mov 0xa8(%rsp),%rax
| _ZN9BlueStore8_do_readEPNS_10CollectionEN5boost13intrusive_ptrINS_5OnodeEEEmmRN4ceph6buffer4listEj():
| }
| BlobRef bptr = lp->blob;
| unsigned l_off = pos - lp->logical_offset
| 37c: mov 0xa0(%rsp),%rdx
| sub 0x18(%rax),%edx
| unsigned b_off = l_off + lp->blob_offset;
0,08 | mov 0x1c(%rax),%ecx
```
With the patch applied:
```
| T * operator->() const
| {
| BOOST_ASSERT( px != 0 );
| return px;
| mov 0x28(%rcx),%rax
| mov 0x8(%rax),%rax
| _ZN9BlueStore8_do_readEPNS_10CollectionEN5boost13intrusive_ptrINS
| unsigned b_len = std::min(left, lp->length - l_off);
|
| ready_regions_t cache_res;
| interval_set<uint32_t> cache_interval;
| bptr->shared_blob->bc.read(
17,78 | lea 0x18(%rax),%rdi
| _ZNK5boost13intrusive_ptrIN9BlueStore10CollectionEEcvbEv():
| #if !defined( BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS ) && !
| && !(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <=
|
| explicit operator bool () const BOOST_NOEXCEPT
| {
| return px != 0;
0,07 | mov 0x8(%rax),%rax
```
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>