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

block: Reduce the chance of inconsistency for inflight I/O #22

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

brenns10
Copy link
Member

@brenns10 brenns10 commented Nov 7, 2023

When reading I/O requests out of a live kernel, there's a pretty good chance that the I/O could complete and the data structure could get freed during the time between when we found the data structure, and when we actually print it.

This means that the list iterators, and the printing functions, all risk reading stale and potentially overwritten data.

We can help reduce the chances of problems with two approaches:

  1. Read the requests into a list ahead of time. This will help avoid the list iterators getting stale data.

  2. Once we have all the requests, dereference the pointer and use .read_() to get a copy of the data that won't change even as the kernel memory changes.

With these two changes, the chance of reading false data is reduced (but not eliminated). It should reduce some flakiness in tests.

When reading I/O requests out of a live kernel, there's a pretty good
chance that the I/O could complete and the data structure could get
freed during the time between when we found the data structure, and when
we actually print it.

This means that the list iterators, and the printing functions, all risk
reading stale and potentially overwritten data.

We can help reduce the chances of problems with two approaches:

1. Read the requests into a list ahead of time. This will help avoid the
list iterators getting stale data.

2. Once we have all the requests, dereference the pointer and use
.read_() to get a copy of the data that won't change even as the kernel
memory changes.

With these two changes, the chance of reading false data is reduced (but
not eliminated). It should reduce some flakiness in tests.

Signed-off-by: Stephen Brennan <[email protected]>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 7, 2023
@brenns10 brenns10 requested a review from biger410 November 7, 2023 21:58
Copy link
Member

@biger410 biger410 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@brenns10 brenns10 merged commit 7e791a9 into oracle-samples:main Nov 7, 2023
5 checks passed
@brenns10 brenns10 deleted the inflight_io_consistency branch November 7, 2023 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants