Skip to content

Conversation

jonathan-albrecht-ibm
Copy link

The test ut0rnd.random_from_interval_fast from test suite merge_innodb_tests-t is failing on s390x on 8.0.34 because the stck (Store Clock) instruction in the my_timer_cycles() function is not very good when used as a source of randomness in random_64_fast().

The stckf (Store Clock Fast) instruction works much better as a source of randomness and is less expensive to call as well. Compared to stck, stckf may store the same clock value twice but according to the Additional Comments comment in mysys/my_rdtsc.cc that should be fine. All 'make test' tests pass with this change.

The stckf instruction was added to the Z Architecture in z9 and all of the s390x versions of distros MySQL supports are compiled for z9 or newer so we don't need to check if it is available.

The test ut0rnd.random_from_interval_fast from test suite
merge_innodb_tests-t is failing on s390x because the stck (Store Clock)
instruction in the my_timer_cycles() function is not very good when used
as a source of randomness in random_64_fast().

The stckf (Store Clock Fast) instruction works much better as a source
of randomness and is less expensive to call as well. Compared to stck,
stckf may store the same clock value twice but according to the Additional
Comments comment in mysys/my_rdtsc.cc that should be fine. All 'make test'
tests pass with this change.

The stckf instruction was added to the Z Architecture in z9 and all of
the s390x versions of distros MySQL supports are compiled for z9 or newer
so we don't need to check if it is available.
@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@jonathan-albrecht-ibm
Copy link
Author

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=112845 for updates.
Thanks

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.

2 participants