]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: mark derivatives of AioContext as final.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 29 Jan 2018 16:27:09 +0000 (17:27 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 1 Feb 2018 11:04:01 +0000 (12:04 +0100)
Profiling `AioReadBatch`, a freshly introduced (at the moment in
a wip branch; see PR #19380) descendant of `AioContext` showed
that CPU cycles are burnt unnecessarily because of the dynamically
polymorphic destructor call that can't be inlined:

It's quite probable the same affects `TransContext` and `DeferredBatch`.
Marking the classes as final allows compiler to inline the dtors calls
in `::aio_finish` and, hopefully, optimize some of the extra overhead.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/os/bluestore/BlueStore.h

index 32f4cde3d9cd34f9f224f270e79a2fe42f723cd7..5ab31791d1094cfdf706eac0e628643aaf67898d 100644 (file)
@@ -1480,7 +1480,7 @@ public:
     }
   };
 
-  struct TransContext : public AioContext {
+  struct TransContext final : public AioContext {
     MEMPOOL_CLASS_HELPERS();
 
     typedef enum {
@@ -1619,7 +1619,7 @@ public:
       boost::intrusive::list_member_hook<>,
       &TransContext::deferred_queue_item> > deferred_queue_t;
 
-  struct DeferredBatch : public AioContext {
+  struct DeferredBatch final : public AioContext {
     OpSequencer *osr;
     struct deferred_io {
       bufferlist bl;    ///< data