Skip to content
Commit 782c121d authored by Andy Ross's avatar Andy Ross Committed by Anas Nashif
Browse files

tests/sched/deadline: Fix precision rollover



The deadline scheduler as of commit ef626571 ("kernel/sched:
Optimize deadline comparison") got an optimization that requires that
the the cycle difference of the deadline time of the "first" and
"last" runnable thread never be higher than 2^31.

The test code here was masking off the bottom 31 bits of the generated
deadlines, so it looked OK.  But because the actual setting of the
deadline values takes time too, it was still possible to select values
that would roll over.  The window was VERY small, but the RNG on one
platform (up_squared) hit it.

Shrink the selected deadlines to live in a 30 bit space for safety.

Fixes #31508

Signed-off-by: default avatarAndy Ross <andrew.j.ross@intel.com>
parent b4929263
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment