]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: put bluefs in the middle of the shared device 14873/head
authorSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 17:05:35 +0000 (12:05 -0500)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 17:05:35 +0000 (12:05 -0500)
If this is an HDD, this will be a shorter average seek distance for an
aged device.

If it is an SSD, it doesn't matter, so don't bother with making this
conditional on is_rotational().

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 61ada2584fff3102828db8156417a6a699019fcb..0cffbd53cce0291c81c26a9b5513c70fb9954f1f 100644 (file)
@@ -4234,9 +4234,11 @@ int BlueStore::_open_db(bool create, bool kv_no_open)
       initial = MAX(initial, cct->_conf->bluestore_bluefs_min);
       // align to bluefs's alloc_size
       initial = P2ROUNDUP(initial, cct->_conf->bluefs_alloc_size);
-      initial += cct->_conf->bluefs_alloc_size - SUPER_RESERVED;
-      bluefs->add_block_extent(bluefs_shared_bdev, SUPER_RESERVED, initial);
-      bluefs_extents.insert(SUPER_RESERVED, initial);
+      // put bluefs in the middle of the device in case it is an HDD
+      uint64_t start = P2ALIGN((bdev->get_size() - initial) / 2,
+                              cct->_conf->bluefs_alloc_size);
+      bluefs->add_block_extent(bluefs_shared_bdev, start, initial);
+      bluefs_extents.insert(start, initial);
     }
 
     bfn = path + "/block.wal";