Proposal for adding O_DIRECT support into JDK 9

Lu, Yingqi yingqi.lu at intel.com
Sat Sep 2 16:05:39 UTC 2017


Hi Brian/Volker,

I have already addressed all the existing issues into webrev.08. However, I found after applying Volker's patch, JDK does not compile on Linux. Error message is listed below:

error: cannot find symbol
            oflags |= O_DIRECT;
                      ^
  symbol:   variable O_DIRECT
  location: class UnixChannelFactory

In addition, I have two more questions:

1.      UnixChannelFactory.java is a common class for all the UNIX based OS, MacOS and Solaris do not have O_DIRECT flag defined. If we specifically use O_DIRECT, will it be an issue?

2.      Does this approach has conflict with the current implementation with fcntl and ReOpenFile() or it is OK to use it on top of the current approach?

Thanks,
Lucy

From: Brian Burkhalter [mailto:brian.burkhalter at oracle.com]
Sent: Friday, September 01, 2017 4:11 PM
To: Lu, Yingqi <yingqi.lu at intel.com>
Cc: nio-dev at openjdk.java.net
Subject: Re: Proposal for adding O_DIRECT support into JDK 9

Hi Lucy,

On Sep 1, 2017, at 7:46 AM, Brian Burkhalter <brian.burkhalter at oracle.com<mailto:brian.burkhalter at oracle.com>> wrote:


Please take a look at this version and let us know your feedback. I would also like to learn what will be a proper approach to solve the AIX issue and what kind of details we need to provide for the exception messages. I will try to incorporate all of those changes into the next version.
I'll try to get back to you on these points today.

Given that the only API-level call which can create a direct FileChannel requires the path and opens the channel then perhaps Volker's patch is OK as-is. The use of fcntl() and ReOpenFile() were intended to provide a more flexible approach better to accommodate potential future changes.

As for the exception messages, for example in the case of a number of bytes not equalling the block size, it might not be a bad idea to include the actual values of the number of bytes and the block size.

On Sep 1, 2017, at 9:13 AM, Lu, Yingqi <yingqi.lu at intel.com<mailto:yingqi.lu at intel.com>> wrote:


I will add the Solaris check for all the tests now and wait for your feedback on the additional tests. All these changes will go into webrev.08.

As of now the tests look to be sufficient but I should take another look next week after the holiday weekend.

Thanks,

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


More information about the nio-dev mailing list