Proposal for adding O_DIRECT support into JDK 9
huaming.li at oracle.com
huaming.li at oracle.com
Tue Sep 5 07:06:18 UTC 2017
Hi Lucy,
On 05/09/2017 2:01 PM, Lu, Yingqi wrote:
>
> Hi Hamlin,
>
> Thank you again for the quick feedback.
>
> Regarding to add an API into ByteBuffer, I like your suggestion. It
> makes DirectIO coding much easier. If everyone agrees, I can add the
> API “ByteBuffer.allocateAlignedDirect(size, alignment)” into
> ByteBuffer. Please let me know if this is appropriate.
>
I think Alan just answered this question.
>
> Regarding to DirectIOTest with mincore, if the test runs on an idle
> system with a reasonable amount of memory, I do not think it will be a
> problem. However, I agree with you that it might be a good idea to add
> some comments. Is something like this sufficient? “This test is to
> check whether a file or part of the file exists in the kernel file
> system cache. As memory pages are not locked in the file system cache,
> result of the test might be stale before the function returns. The
> test should not be run concurrently with other programs that clear
> file system cache”
As I know, if the test is put as part of jdk regression test, we can not
control the test environment where it's busy or idle. But the clarifying
comment is better. Maybe we can address the issue later when we face the
real failure in test environment.
>
> I will add one more test for “not aligned buffer position” check.
> Thank you for pointing this out.
>
OK.
>
> Base on my understanding, we cannot write to a file the length of
> which is not aligned without padding. I think this the expected
> behavior of DirectIO. In Java applications, user need to work on their
> own padding.
>
Got it.
Thank you
-Hamlin
>
> Thanks,
>
> Lucy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170905/4198c25a/attachment.html>
More information about the nio-dev
mailing list