Proposal for adding O_DIRECT support into JDK 9

Lu, Yingqi yingqi.lu at intel.com
Thu Nov 17 17:05:46 UTC 2016


Hi Philippe,

Thank you very much for your feedback. We can certainly change FileStore.getBlockSize to default method. We will make this modification into our next version of the patch.

All, 

Besides this change, do you have any other feedback and comments?

Thanks,
Lucy

>-----Original Message-----
>From: Philippe Marschall [mailto:philippe.marschall at gmail.com]
>Sent: Thursday, November 17, 2016 6:02 AM
>To: nio-dev at openjdk.java.net
>Cc: Alan Bateman <Alan.Bateman at oracle.com>; Lu, Yingqi
><yingqi.lu at intel.com>; Kharbas, Kishor <kishor.kharbas at intel.com>; David
>Holmes <david.holmes at oracle.com>; 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
>
>I'm just a lurker so excuse me when overstep some boundaries here.
>Assuming FileStore#getBlockSize stays:
>- Could that be changed into a default method? That would be a help for any file
>system implementer (eg myself) and would also simplify JrtFileStore and
>ZipFileStore.
>- Could the Javadoc be updated to state that throwing
>UnsupportedOperationException is valid?
>
>Cheers
>Philippe
>
>On Wed, Nov 16, 2016 at 11:14 PM, Lu, Yingqi <yingqi.lu at intel.com> wrote:
>> 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>
>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 nio-dev mailing list