Proposal for adding O_DIRECT support into JDK 9

Brian Burkhalter brian.burkhalter at oracle.com
Mon Sep 18 19:02:04 UTC 2017


Hi Lucy,

On Sep 16, 2017, at 10:20 AM, Lu, Yingqi <yingqi.lu at intel.com> wrote:

> I tested the current DirectIOTest on my Linux CentOS system for 200,000 iterations, they all passed. I tested the same test on MacOS VM for 20 iteration, some of them failed with the “file in cache” error while the rest passed.
>  
> I searched online, and found this thread https://lists.apple.com/archives/filesystem-dev/2007/Sep/msg00012.html. If F_NOCACHE flag is set, an IO block might exist in the file system cache for a very short amount of time and then will be evicted.
>  
> Then, I tried to add a 200 milliseconds delay between testWrite() and isFileInCache() as well as testRead() and isFileInCache(). I again did 100,000 iterations of DirectIOTest, they all passed. 200,000 iterations take too much time on my VM which is hosted on a tiny desktop J
>  
> I will test DirectIOTest on Solaris VM as well for 100,000 iterations and see how it behaves with and without the delay. My thinking is to add the delay for the platforms who need it.

We can try that but often having a sleep call eventually results in the test’s intermittently failing nonetheless. If that situation is observed then eventually we might just restrict this test further to the platforms on which it passes consistently. As Linux is the real target here that would not be tragic but it would be better to have it work on the other supported Unix flavors if possible.

> By the way, I already fixed the DirectIOTest.isDirectIOSupportedByFS() issue on Solaris. I will submit another version of the patch by Monday.

OK, good.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170918/c51e423a/attachment.html>


More information about the nio-dev mailing list