Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hudson-ayers
Copy link
Contributor

Pull Request Overview

This pull request fixes a potential (though as of yet undetected) bug in the kernel's use of the SchedulerTimer trait, where the kernel checked for expiration of the timer, then checked the amount of time remaining, not considering the possibility that the timer could wraparound in period between those checks, causing the kernel to read an invalid time remaining value. This was identified by @bradjc .

Rather than just fix the bug, we decided to change the interface slightly to make this misuse impossible -- rather than separate has_expired() and get_remaining_us() functions, there is now only a get_remaining_us() function, which returns None if the timer has expired.

This PR also includes lots of documentation updates by @bradjc that clarify the SchedulerTimer interface further.

Testing Strategy

This pull request was tested by running several apps simultaneously on Imix, incuding whileone, and verifying that timeslice expiration still works as expected.

TODO or Help Wanted

N/A

Documentation Updated

  • No updates are required.

Formatting

  • Ran make prepush.

bradjc and others added 3 commits September 11, 2020 12:20
@bradjc
Copy link
Contributor

bradjc commented Sep 14, 2020

The other issue with the current interface is a user could call has_expired(), get a false return value, and then reasonably call get_remaining_us() to see how much time is remaining. However, the timer could have expired between those two calls, and once it has, the call to get_remaining_us() is invalid.

@bradjc
Copy link
Contributor

bradjc commented Sep 17, 2020

I'm nominating this for release-blocker.

@bradjc bradjc added the release-blocker Issue or PR that must be resolved before the next release label Sep 17, 2020
@phil-levis
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 19, 2020

Build failed:

@hudson-ayers
Copy link
Contributor Author

bors retry

@bors
Copy link
Contributor

bors bot commented Sep 20, 2020

@bors bors bot merged commit ad9387a into master Sep 20, 2020
@bors bors bot deleted the scheduler-timer-doc branch September 20, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocker Issue or PR that must be resolved before the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants