From: Sage Weil Date: Fri, 28 Apr 2017 17:05:35 +0000 (-0500) Subject: os/bluestore: put bluefs in the middle of the shared device X-Git-Tag: v12.1.0~10^2~90^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=50f20d39f53c54d76e9199d41faa0104cd2ec0d7;p=ceph.git os/bluestore: put bluefs in the middle of the shared device 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 61ada2584fff..0cffbd53cce0 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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";