-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8357847: (ch) WindowsAsynchronousFileChannelImpl should support FFM Buffers #25531
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
base: master
Are you sure you want to change the base?
8357847: (ch) WindowsAsynchronousFileChannelImpl should support FFM Buffers #25531
Conversation
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
@bplb This will need tests to exercise the read/write methods with buffers that a views on memory segments allocated from automatic and shared arenas. I think we also need to check that we have tests to ensure that UOE is thrown for thread confined arenas. |
buf = dst; | ||
address = ((DirectBuffer)dst).address() + pos; | ||
IOUtil.acquireScope(dst, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we'll have to change this to use IOUtil.bufferAddress(dst), and after the acquire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that using IOUtil.bufferAddress()
would be correct here. The reason is that it calls JavaNioAccess.getBufferAddress()
which returns the value of address
hoisted into Buffer
thereby circumventing the check for closable shared sessions mentioned below.
There is already testing on automatic arenas, I believe, and passing in a shared arena resulted in a UOE.
I observed this UOE already so that should be simple. |
We should be able to use a buffer that is a view of memory segment allocated from shared arena, only the confined case should throw UOE. |
I ran into this in testing:
in |
My previous comment wasn't correct, the above code where it checks isCloseable is correct. We should be able to use a buffer from a view allocated from the global arena or an automatic arena. It should throw UOE for confined and shared. |
Currently
Other cases could be added there, e.g.,
The UOE for confined and shared might have to be checked elsewhere. I'll examine it further. |
It throws |
Acquire the scope of a direct buffer before it is used and release it after the task has finished with it, whether the task execution is immediate or pended.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25531/head:pull/25531
$ git checkout pull/25531
Update a local copy of the PR:
$ git checkout pull/25531
$ git pull https://git.openjdk.org/jdk.git pull/25531/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25531
View PR using the GUI difftool:
$ git pr show -t 25531
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25531.diff
Using Webrev
Link to Webrev Comment