-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add label to io_threaded_fallbacks to categorize operations #108
base: v24.3.x
Are you sure you want to change the base?
Conversation
src/core/thread_pool.hh
Outdated
@@ -27,9 +27,53 @@ namespace seastar { | |||
|
|||
class reactor; | |||
|
|||
enum class submit_reason { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(should probably document each reason as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added docs.
uint64_t process_operation{0}; | ||
uint64_t unknown{0}; | ||
|
||
void record_reason(submit_reason reason) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to make this "generic" (i.e., no need for O(n) clauses for n reasons), e.g., using an array of counters and indexing with the enum value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, I like that idea. Will switch the code over to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
} | ||
|
||
uint64_t count_for(submit_reason reason) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
return inter_thread_wq.submit<T>(std::move(func)); | ||
} | ||
uint64_t operation_count() const { return _aio_threaded_fallbacks; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this deleted? It could still be implemented with the same semantics as before, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, summing all the reasons will have the same semantics as before. It's just not used anywhere else in the codebase so I removed it as dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, because the old metric is replaced entirely with the one the labels, makes sense. Not sure if seastar team will buy into not keeping the old metric (w/o labels) around but let's see.
src/core/thread_pool.hh
Outdated
@@ -27,9 +27,53 @@ namespace seastar { | |||
|
|||
class reactor; | |||
|
|||
enum class submit_reason { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(should probably document each reason as well)
57dc8bb
to
4974a41
Compare
4974a41
to
646adfb
Compare
sm::description("Total number of io-threaded-fallbacks operations")), | ||
|
||
io_fallback_counter("aio_fallback", submit_reason::aio_fallback), | ||
// total_operations value:DERIVE:0:U |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you even understand these comments? I sure don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, it's collectd stuff: https://www.collectd.org/documentation/manpages/types.db.html#:~:text=db%20file%20contains%20collectd's%20metric,bytes%E2%80%9D%20and%20%E2%80%9Ctotal_bytes%E2%80%9D.
I was wondering the same in the past
@@ -27,9 +27,36 @@ namespace seastar { | |||
|
|||
class reactor; | |||
|
|||
// Reasons for why a function had to be submitted to the thread_pool | |||
enum class submit_reason : size_t { | |||
// Used for aio operations what would block in `io_submit`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, isn't it actually "used as a fallback for io operations that failed to execute in a non-blocking manner in their first submission to io_submit"?
Maybe it's splitting hairs but the way it's written makes it sounds like we know that some operation will block and then we can redirect them to the thread pool, but it's actually based on what happened on a per-op basis during submission, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, I probably removed too much context in an attempt to make the comment succinct. Will add some back.
646adfb
to
f538975
Compare
@travisdowns the branch has been rebased to v24.3.x. Going to get a PR up for this in upstream seastar as well. |
The main purpose of this PR is to allow us to know how many of the operations submitted to the thread pool are from failed aio reads/writes.