-
Notifications
You must be signed in to change notification settings - Fork 7.4k
RTIO: Add Workqueue support for delayed work items #77100
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
Comments
@FlorianWeber1018 LMK if you have any additional inputs on this! |
This is an interesting addition for combining RTIO and this particular Video driver:
|
Thanks for sharing this! I'll find some time soon on this addition |
this would be a great addition since quite some hardware sensors do need a significant delay between triggering a new measurement and fetching the data. |
We should add a OP_DELAY that wraps a k_timer to solve this in an asynchronous manner |
Sounds good. I'm planning to come back to this soon |
We may need a k_timer pool :/ |
I was counting on the k_timer struct not being that significant to be contained within the SQE union (similar to tiny_tx) but I see it goes way beyond in size compared to the other elements. I agree a pool is the way to go in this case (edit: I dropped some comments below after thinking through a bit more). FWIW - If we're concerned on RTIO memory footprint, we can always hide it behind a Kconfig setting (turned off by default, unless used by a client). |
Hopefully not going off in a tangent here: one thing we may want to discuss is how do we want to assist users properly sizing the different pools that RTIO has for it to properly work. They already have to account for:
Otherwise we may be making RTIO harder to use (or to trust it won't just break at run-time in X corner case). |
Ok, I've come with a PR to address this feature, using a separate SQE OP (OP_DELAY). This is not inherently a RTIO Workqueue delay, but this use-case can be covered by simply chaining a delay with a RTIO workqueue item. PR Link: #88808 |
Uh oh!
There was an error while loading. Please reload this page.
Is your enhancement proposal related to a problem? Please describe.
Based on a discussion in #74389, it was brought up that some RTIO users may need to perform transactions spaced by time-intervals. This is similar to how the Zephyr Workqueue works. Right now it is not possible as the RTIO Workqueue service does not have any means to achieve this.
Describe the solution you'd like
Add the ability to the RTIO Workqueue service to achieve this functionality.
This could be, for instance, achieved by adding an API
rtio_work_req_schedule()
similar tortio_work_req_submit
but with ak_timeout_t
parameter describing when this item is due for execution.Describe alternatives you've considered
Have users implement this functionality out of the RTIO workqueue service (e.g: have an additional delayed work item which in turn submits the RTIO workq item). This may be a short-term solution but does not seem scalable as more users re-invent the same functionality.
Additional considerations
This is a well-known feature already supported by the Zephyr workqueue, and that users are familiar with, which is why IMO it makes sense to include it under this service.
The text was updated successfully, but these errors were encountered: