Repository navigation
crimson/os/seastore: Add Seastore phase latency scaffolding - #69292
perezjosibm wants to merge 1 commit into
Conversation
7db432f to
8848bc4
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
8848bc4 to
ce2e6b8
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
2433596 to
f2e34ef
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
@ronen-fr This PR does not invent a new mechanism, it simply uses the existing seastore perf counters to measure phases in the write I/O path, with the aim to provide a profile of the latencies/time spent during those phases. |
f2e34ef to
57cf2ef
Compare
There was a problem hiding this comment.
Pull request overview
Adds transaction-local write-phase latency accounting and per-shard Seastore metrics.
Changes:
- Adds scoped phase timers and transaction-local accumulation.
- Instruments mapping, cache, packing, commit, metadata, and durability paths.
- Exports phase histograms and cumulative counters.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
transaction.h |
Defines phase buckets, statistics, and scoped timers. |
transaction_manager.h |
Instruments mapping and cache operations. |
transaction_manager.cc |
Instruments mapping updates and durability. |
seastore.h |
Adds per-shard phase metric storage and publishing. |
seastore.cc |
Registers metrics and instruments transaction phases. |
extent_placement_manager.cc |
Measures write-packing work. |
Comments suppressed due to low confidence (1)
src/crimson/os/seastore/seastore.cc:2208
- As above, this local timer is destroyed when the continuation returns, before an asynchronous destination-onode lookup completes. Retain it until
get_or_create_onode()resolves sometadata_lookupmeasures the actual operation.
auto phase_latency =
ctx.transaction->record_phase_latency(
phase_latency_bucket_t::metadata_lookup);
|
jenkins test make check arm64 |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
Sorry @shraddhaag: this PR might have been deprecated by the recent performance instrumentation changes, will try rebase and solving the conflicts will point out the redundancies. |
57cf2ef to
bf7ab59
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
bf7ab59 to
d9fc755
Compare
d9fc755 to
902dfb6
Compare
txn_stage_t splits do_transaction into consecutive stages, which shows where a transaction spends its time but not what kind of work that time goes into: everything before submit_transaction is reported as a single BUILD sample. Add a complementary, cross-cutting breakdown: a per-transaction phase_latency_stats_t fed by an RAII scope timer placed where the work actually happens (onode lookups, LBA mapping operations, Cache extent alloc/retire, OOL write packing), aggregated into the new seastore_phase_lat histogram plus seastore_phase_lat_ns / seastore_phase_lat_scopes counters, labelled by phase. The buckets are restricted to work that is not already measured elsewhere. submit_transaction as a whole, journal->submit_record and update_lba_mappings are left out because txn_stage_t::SUBMIT_TOTAL, SUBMIT_JOURNAL and SUBMIT_LBA_UPDATE (Transaction::phase_durations_t) already time exactly those spans with the same clock; only the build-time mapping work is timed here. Like phase_durations_t, the accumulators use steady_clock and survive reset_preserve_handle(), so a replayed transaction reports the total cost of all its attempts. Histogram buckets are initialised in register_metrics() following the op_lat/stage_lat pattern, with sub-millisecond bounds since these phases are usually microseconds. Buckets may nest, so their totals are not expected to sum to the transaction latency. Note that this adds two steady_clock reads to hot per-extent paths (get_pin, alloc_*_extent); if that proves measurable, the timers should be made conditional. Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: Jose J Palacios-Perez <[email protected]>
902dfb6 to
97bd139
Compare
Implement a light-weight instrumentation for the write path in Seastore:
Seastore already exposes end-to-end operation latency (
seastore_op_lat) and aconsecutive-stage breakdown of
do_transaction(seastore_do_transaction_stage_lat,driven by
txn_stage_t). Neither answers what kind of work a transaction spendsits time on: everything before
submit_transactionarrives as a singleBUILDsample.This adds a complementary, cross-cutting breakdown. A per-transaction
phase_latency_stats_tis fed by an RAII scope timer placed where the work actuallyhappens, then aggregated per shard and exported as Seastar metrics.
Exported metrics
seastore_phase_latphase,shard_store_indexseastore_phase_lat_nsphase,shard_store_indexseastore_phase_lat_scopesphase,shard_store_index_ns / _scopes= mean cost of one operationSub-millisecond bounds are used deliberately: unlike the
txn_stage_thistograms theseare fed from
steady_clock, and most phases complete in microseconds.Phases and where they are timed
metadata_lookup_do_transaction_step()—seastore.cc(3 sites)mapping_managementclone_range(),remove_mappings_in_range()—transaction_manager.ccwrite_packingextent_placement_manager.cccache_mutationDeliberately excluded
Buckets are restricted to work not already measured elsewhere.
submit_transactionas awhole,
journal->submit_recordandupdate_lba_mappingsare left out becausetxn_stage_t::SUBMIT_TOTAL,SUBMIT_JOURNALandSUBMIT_LBA_UPDATE(
Transaction::phase_durations_t) already time those spans with the same clock. Only thebuild-time mapping work is timed here. Likewise
write_packingcovers only the packing,not the device writes — those are
phase_durations_t::ool_write.Semantics worth reviewing
transaction latency. A bucket is timed from the outermost
enter()to the matchingoutermost
exit(), so recursive/concurrent scopes of the same bucket count once.phase_durations_t, accumulators survivereset_preserve_handle(),so a replayed transaction reports the total cost of all its attempts.
alive until the future resolves; a plain local would only time the synchronous part of
a function returning a future.
Grafana dashboard
monitoring/crimson/gen_dashboard.pygains four panels in the SeaStore row (JSONregenerated; edit the generator, not the JSON):
_sum / _counthistogram_quantileover_bucket_ns / _scopesrate(_ns)Panels are intentionally not stacked, since nested phases overlap.
Overhead
This adds two
steady_clockreads to hot per-extent paths (get_pin,alloc_*_extent).If that proves measurable the timers should be made conditional — feedback welcome on
whether to gate them from the outset.
Known gaps
cache_mutationis defined inphase_latency_bucket_tbut has no call site yet, so itcurrently reports zero. Kept in the enum as the intended extent alloc/retire bucket.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.