Proposal for adding O_DIRECT support into JDK 9
Lu, Yingqi
yingqi.lu at intel.com
Fri Sep 15 18:00:51 UTC 2017
Hi Alan and Brian,
Please find version 14 of the patch is available at http://cr.openjdk.java.net/~kkharbas/8164900/webrev.14/
In this version, I did following two changes:
1. Move position alignment check for non-positional read/write inside synchronized (positionLock) block. For positional read/write (position is provided as a parameter from user), I keep the check outside the synchronized block. Since the position is an absolute number, I think it should be OK?
2. In IOUtil.read of version 13, I saw alignment check was done on "rem" where rem = dst.remaining(). However, getTemporaryAlignedDirectBuffer and getTemporaryDirectBuffer were using dst.remaining(). I am not sure if this is the place you refer to in your email. In this version, I make all three functions use rem. Please let me know if I misunderstand.
Thanks,
Lucy
From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
Sent: Friday, September 15, 2017 4:53 AM
To: Lu, Yingqi <yingqi.lu at intel.com>; Brian Burkhalter <brian.burkhalter at oracle.com>
Cc: nio-dev at openjdk.java.net
Subject: Re: Proposal for adding O_DIRECT support into JDK 9
On 14/09/2017 23:28, Lu, Yingqi wrote:
Hi Brian and Alan,
Please find the version 13 of the patch is available at http://cr.openjdk.java.net/~kkharbas/8164900/webrev.13/<http://cr.openjdk.java.net/%7Ekkharbas/8164900/webrev.13/>
In this version, I have addressed Alan's most recent feedback.
I think we are close but I'm still concerned about the position check in FileChannel.read/write. This has to be done while holding positionLock, otherwise there is no guarantee that the position hasn't changed (I wasn't clear in my mail yesterday).
One other issue is in IOUtil.read where the alignment check is done on dst.remaining(), it should be "rem". The other checks look correct.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170915/9265ca80/attachment.html>
More information about the nio-dev
mailing list