-
Notifications
You must be signed in to change notification settings - Fork 10
Improvements to the DTO_WAIT_METHODS #16
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
Conversation
byrnedj
commented
Jun 11, 2025
- use busypoll and autotune as defaults
- add tpause instruction
- change to use compiler intrinsics for UMWAIT and TPAUSE
- update the documentation for using UMWAIT
- clean up wait_method paths
- update min size to 32K
1. use busypoll and autotune as defaults 2. add tpause instruction 3. change to use compiler intrinsics for UMWAIT and TPAUSE 4. update the documentation for using UMWAIT 5. clean up wait_method paths
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.
Pull Request Overview
This PR improves the DTO wait methods by updating default wait behaviors, adding support for the TPAUSE instruction, and updating intrinsics and documentation accordingly.
- Change default wait method from yield to busypoll
- Introduce TPAUSE wait method and update UMWAIT intrinsics usage
- Update documentation in README and add build flag changes in the Makefile
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
dto.c | Updates wait methods, uses compiler intrinsics, and adds TPAUSE support. |
README.md | Updates documentation for new wait methods including TPAUSE. |
Makefile | Adds the -mwaitpkg flag needed for the new intrinsics. |
Comments suppressed due to low confidence (2)
dto.c:394
- There's an inconsistency in the TPAUSE wake-up state between 'dsa_wait_tpause' (using C02_STATE) and the TPAUSE branch in '__dsa_wait' (using C01_STATE). Consider aligning these values or documenting the rationale for the difference.
_tpause( C01_STATE, _rdtsc() + TPAUSE_C01_DELAY_NS);
dto.c:1148
- The condition for enabling the TPAUSE wait method relies on the 'umwait_support' flag. If TPAUSE has separate hardware or library support requirements, consider verifying TPAUSE support explicitly.
if (!strncmp(env_str, wait_names[WAIT_TPAUSE], strlen(wait_names[WAIT_TPAUSE]))) {
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.
Is tpause supported if umwait is supported? Should there be a separate check for tpause support?
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 is in reference to line 1149
Co-authored-by: Copilot <[email protected]>