Proposal for adding O_DIRECT support into JDK 9

Lu, Yingqi at
Mon Aug 28 17:32:03 UTC 2017

Hi Alan,

Thank you very much for your feedback! I will modify accordingly and send the webrev.06 here for review shortly.

Couple questions I want to make sure:

1.     Regarding to DirectIO test, do you mean uploading the native library into the build? If yes, we can do that for Linux 64bit and MacOS 64bit (from a virtual machine). I will need help from the community to add libraries that support other OSes.

2.     Could you please provide the line number for the comment below?

-[])/write(ByteBuffer[]) loop over buffers but they should only do this when direct is true.

From: Alan Bateman [mailto:Alan.Bateman at]
Sent: Monday, August 28, 2017 5:50 AM
To: Lu, Yingqi < at>; Brian Burkhalter <brian.burkhalter at>; Markle, Seth <smarkle at>
Cc: nio-dev at
Subject: Re: Proposal for adding O_DIRECT support into JDK 9

On 25/08/2017 17:38, Lu, Yingqi wrote:

Dear All,

Please let us know if you have any additional feedback or questions on this patch.

Patch is available at<>

JBS link is available at

I looked through the latest webrev and I think it's looking quite good (all the issues that we discussed previously have been addressed).

I think Brian is looking through the tests but one question on DirectIO is whether you place to convert that into a native test that is compiled in the build. It may otherwise get forgotten.

A few minor comments:

- FileStore::getBlockSize - the throws UOE can be dropped from the signature as it's unchecked (leave the @throws UOE in the javadoc of course)

- FileChannelImpl can be created without a path so it might be useful to add "assert path != null" to the direct case as we should never create a FileChannel for direct I/O but without a path.

- Minor nit but the "//" comments need a spec to be consistent with the existing comments.

-[])/write(ByteBuffer[]) loop over buffers but they should only do this when direct is true.

- FileDispatcher.setDirectIO - "{" can be moved up to the previous line.

I think that is all I have for now.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nio-dev mailing list