Proposal for adding O_DIRECT support into JDK 9
Lu, Yingqi
yingqi.lu at intel.com
Wed Nov 16 22:14:36 UTC 2016
Hi All,
Our most recent version of our DirectIO patch is available at http://cr.openjdk.java.net/~kkharbas/8164900/webrev.04/
In this version, we have modified the following items:
1. Remove ByteBuffer.allocateDirectAligned() and ByteBuffer.isAligned(). Instead, using existing APIs alignmentOffset() and alignedSlice()
2. Use Block Size as the alignment value instead of OS page size
3. Create a function named getBlockSize from FileStore class
4. Implement DirectIO for Windows
5. JTreg test passed for Windows, Linux and OS X with regarding to the DirectIO changes we made
Please let us know your comments and feedback. Thank you very much for your consideration!
Thanks,
Lucy
From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Lu, Yingqi
Sent: Sunday, November 06, 2016 9:37 AM
To: Alan Bateman <Alan.Bateman at oracle.com>
Cc: Kharbas, Kishor <kishor.kharbas at intel.com>; David Holmes <david.holmes at oracle.com>; core-libs-dev at openjdk.java.net; nio-dev at openjdk.java.net; Thomas Stüfe <thomas.stuefe at gmail.com>; Kaczmarek, Eric <eric.kaczmarek at intel.com>
Subject: Re: Proposal for adding O_DIRECT support into JDK 9
Hi Alan,
Thank you very much for your suggestion. FileStore is a better home for the alignment value. We will use It in our next version of the patch and update here for review soon.
Thanks,
Lucy
Sent from my iPhone
On Nov 6, 2016, at 9:04 AM, Alan Bateman <Alan.Bateman at oracle.com<mailto:Alan.Bateman at oracle.com>> wrote:
On 06/11/2016 15:51, Lu, Yingqi wrote:
Another approach might be use ioctl to get the block size and use that as the alignment value. I think ioctl is available on UNIX based OSes (please chime in if I miss any OS here) and has a similar call for Windows named DeviceIoControl. The request code of ioctl is different from OS to OS, but we could address that in the native code.
A possible approach (I think I mentioned this in one of the early mails) is to have FileStore expose the block size that can be use to align and size the buffer.
-Alan
More information about the core-libs-dev
mailing list