Proposal for adding O_DIRECT support into JDK 9

Lu, Yingqi at
Mon Sep 26 18:17:06 UTC 2016

Hi All,

The second version of the patch is now available at In this version, we moved the O_DIRECT support from FIS/FOS/RAF to FileChannel. We implemented O_DIRECT as a StandardOpenOption. The reason we did not make it as one of the ExtendedOpenOptions is because we found ExtendedOpenOption is now moved to jdk.unsupported. Please let us know if we misunderstood anything here. We can modify it accordingly if there is a better place to put this flag.

Please let us know your feedback and comments on the patch!


-----Original Message-----
From: core-libs-dev [mailto:core-libs-dev-bounces at] On Behalf Of Lu, Yingqi
Sent: Saturday, August 27, 2016 9:01 AM
To: Alan Bateman <Alan.Bateman at>
Cc: core-libs-dev at; Kaczmarek, Eric <eric.kaczmarek at>
Subject: Re: Proposal for adding O_DIRECT support into JDK 9

The workload we have uses fis/fos/raf, that is why we started here following the example of other file open flags. We can surely look into filechannel extended open options to see if it fits better there. 


Sent from my iPhone

> On Aug 27, 2016, at 12:43 AM, Alan Bateman <Alan.Bateman at> wrote:
>> On 26/08/2016 23:31, Lu, Yingqi wrote:
>> Dear All,
>> This is a proposal for adding O_DIRECT support into JDK 9 for reading/writing from/to a file on Linux platform. O_DIRECT is a file-open flag to pass to OPEN (2). It tries to minimize cache effects of the I/O to and from this file. File I/O is done directly to/from user-space buffers. Please refer to for more details.
> FIS/FOS/RAF doesn't seem the right place for this. Have you looked at using extended open options with FileChannel instead?
> -Alan

More information about the core-libs-dev mailing list