Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ sudo build/Debug/src/test/legacy_ublk/homeblk_ublk \
| `--vol_size_mb` / `--page_size` | Volume size and logical block size (default 4096) when creating. |
| `--num_threads` | HomeBlocks iomgr reactor count. |
| `--data_chunk_size_mb` / `--index_chunk_size_mb` | HomeStore chunk sizing (see the note below). |
| `--dynamic_chunk_allocation=<true\|false>` | Lazy (thin) data chunk allocation for new volumes: `true` starts a volume with a few chunks and grows on demand, `false` pre-allocates all of its chunks at create. Overrides the `dynamic_chunk_allocation` dynamic config (default `true`). |
| `--device_id <n>` | ublk device id: `-1` to assign one, `>=0` to recover a kernel-preserved device. |

In another terminal, drive I/O at the printed device. All raw I/O is `O_DIRECT` with the volume's page size as
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class HomeBlocksConan(ConanFile):
name = "homeblocks"
version = "6.0.10"
version = "6.0.11"

homepage = "https://github.com/eBay/HomeBlocks"
description = "Block Store built on HomeStore"
Expand Down
3 changes: 3 additions & 0 deletions src/lib/home_blks_config.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ table HomeBlksSettings{
// homestore dataservice chunk size;
hs_data_chunk_size_mb: uint32 = 2048;

// lazy chunk allocator on/off
dynamic_chunk_allocation: bool = true;
Comment thread
nnastonen marked this conversation as resolved.

// how often (in appended LSNs) the leader auto-proposes a SyncRSCommitLSN entry; also gates how
// often a commit_lsn advance triggers a HomeStore checkpoint (SDSTOR-22888, CraftReplDev::
// checkpoint_lsn_interval_), tying checkpoint cadence to this same periodic cadence;
Expand Down
10 changes: 10 additions & 0 deletions src/lib/homeblks_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ hs_chunk_size_cfg_t HomeBlocksImpl::get_chunk_size() const {
return hs_chunk_sz;
}

bool HomeBlocksImpl::dynamic_chunk_allocation() const {
if (SISL_OPTIONS.count("dynamic_chunk_allocation")) {
auto const on = SISL_OPTIONS["dynamic_chunk_allocation"].as< bool >();
LOGI("Using dynamic_chunk_allocation option value: {}", on);
return on;
}

return HB_DYNAMIC_CONFIG(dynamic_chunk_allocation);
}

void HomeBlocksImpl::init_homestore() {
LOGI("Starting iomgr with {} threads", config_.threads);
ioenvironment.with_iomgr(iomgr::iomgr_params{.num_threads = config_.threads}).with_http_server();
Expand Down
1 change: 1 addition & 0 deletions src/lib/homeblks_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class HomeBlocksImpl : public home_blocks, public std::enable_shared_from_this<
bool is_restricted() const { return is_restricted_.load(); }
bool is_shutting_down() const { return shutdown_started_.test(); }
hs_chunk_size_cfg_t get_chunk_size() const;
bool dynamic_chunk_allocation() const;
bool is_graceful_shutdown() const { return gracefully_shutdown_; }

public:
Expand Down
2 changes: 2 additions & 0 deletions src/lib/volume/tests/test_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ SISL_OPTION_GROUP(
"number"),
(index_chunk_size_mb, "", "index_chunk_size_mb", "index_chunk_size_mb",
::cxxopts::value< uint32_t >()->default_value("128"), "number"),
(dynamic_chunk_allocation, "", "dynamic_chunk_allocation", "lazy chunk allocation on/off",
::cxxopts::value< bool >()->default_value("true"), "true or false"),
(data_chunk_size_mb, "", "data_chunk_size_mb", "data_chunk_size_mb",
::cxxopts::value< uint32_t >()->default_value("128"), "number"));

Expand Down
Loading
Loading