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

More WriteGather fixes #109826

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

More WriteGather fixes #109826

wants to merge 5 commits into from

Conversation

adamsitnik
Copy link
Member

  • macOS does not define IOV_MAX, it uses UIO_MAXIOV instead
  • don't run these tests in parallel, as each test cases uses more than 4 GB ram and disk
  • fix the test: handle incomplete reads that should happen when we hit the max buffer limit
  • incomplete write fix:
    • pin the buffers only once
    • when re-trying, do that only for the actual reminder

@adamsitnik adamsitnik added this to the 10.0.0 milestone Nov 14, 2024
@adamsitnik adamsitnik self-assigned this Nov 14, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

ReadOnlyMemory<byte> buffer = buffers[i];
totalBytesToWrite += buffer.Length;

MemoryHandle memoryHandle = buffer.Pin();
Copy link
Member Author

@adamsitnik adamsitnik Nov 14, 2024

Choose a reason for hiding this comment

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

So far, for incomplete writes we were pinning the memory for every retry attempt. I am not sure if this can create some kind of edge case bugs, but I think we can do it just once, before we enter the main loop

{
if (asyncMethod)
{
await RandomAccess.WriteAsync(sfh, writeBuffers, fileOffset);
bytesRead = await RandomAccess.ReadAsync(sfh, readBuffers, fileOffset);
Copy link
Member Author

Choose a reason for hiding this comment

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

this was a test bug, the test assumed that the read won't ever be a partial read

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adamsitnik
Copy link
Member Author

/azp run runtime-libraries-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant