Skip to content
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

WIP: RTIO 1-shot akm09918 implementation #9

Open
wants to merge 15 commits into
base: peress/sensors
Choose a base branch
from

Conversation

tristan-google
Copy link

These can be squashed together before merging

teburd and others added 15 commits May 2, 2023 10:07
Rather than the rings, which weren't shared between userspace and kernel
space in Zephyr like they are in Linux with io_uring, use atomic mpsc
queues for submission and completion queues.

Most importantly this removes a potential head of line blocker in the
submission queue as the sqe would be held until a task is completed.

As additional bonuses this avoids some additional locks and restrictions
about what can be submitted and where. It also removes the need for
two executors as all chains/transactions are done concurrently.

Lastly this opens up the possibility for a common pool of sqe's to
allocate from potentially saving lots of memory.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Test throughput of submit and consume pair for rtio

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
On non-smp systems where multiple cores aren't in play atomics aren't
really necessary and volatile can be used in stead.

Additionally marks the push function as ALWAYS_INLINE as I saw at times
it was not being inlined.

MPSC operation speed is crucial to the performance of rtio, these changes
provided a 30% throughput improvmement in the throughput test.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Reworks the zephyr macros and pools to be objects in their own right. Each
pool can be statically defined with a Z_ private macro. The objects can
then be initialized with an rtio instance statically.

This cleans up a lot of code that was otherwise doing little bits of
management around allocation/freeing and reduces the scope those functions
has to the data it needs.

This should enable sharing the pools of sqe, cqe, and mem blocks among rtio
instances in a future improvement easily.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Add a memset to clear out the sqe prior to running any of the
rtio_sqe_prep_* functions.

Signed-off-by: Yuval Peress <peress@google.com>
topic#rtio_multishot
- Add a new API `rtio_sqe_cancel` to attempt canceling a queued SQE
- Add a new syscall `rtio_sqe_copy_in_get_handles` which allows getting
  back the SQE handles generated by the copy_in operation so that they
  can be canceled.

Signed-off-by: Yuval Peress <peress@google.com>
topic#rtio_multishot
- Introduce multishot reads which remain on the SQ until canceled

Signed-off-by: Yuval Peress <peress@google.com>
topic#rtio_multishot
Add a new async API based on the RTIO subsystem. This new API allows:
1. Users to create sampling configs (telling the sensor which channels
   they want to sample together).
2. Sample data in an asynchronous manner which provides greater control
   over the data processing priority.
3. Fully backwards compatible API with no driver changes needed for
   functionality (they are needed to improve performance).
4. Helper functions for processing loop.

Signed-off-by: Yuval Peress <peress@google.com>
Update the sensor shell logic to use the new sensor_read() APIs

Signed-off-by: Yuval Peress <peress@google.com>
Once zephyrproject-rtos#57130 merges this will not be needed.

Signed-off-by: Yuval Peress <peress@google.com>
Signed-off-by: Yuval Peress <peress@google.com>
@yperess yperess force-pushed the peress/sensors branch 15 times, most recently from aafcb9c to 1dd06c2 Compare May 18, 2023 14:34
@yperess yperess force-pushed the peress/sensors branch 3 times, most recently from cd5c2b2 to 0cebe93 Compare June 6, 2023 02:26
@yperess yperess force-pushed the peress/sensors branch 3 times, most recently from c26fdc6 to 0a11578 Compare June 27, 2023 07:15
@yperess yperess force-pushed the peress/sensors branch 2 times, most recently from 3da09b0 to 0f77322 Compare July 11, 2023 08:05
yperess pushed a commit that referenced this pull request Mar 14, 2024
D9/SCK pin is #9 pin, not #0.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants