Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-16 Thread Andrew Dinn
On 16/05/2019 14:14, Alan Bateman wrote: > Mikael's suggestion seem okay. This is under the hood implementation so > doesn't matter if there is a follow-on issue or you include it in the > bigger patch. It might be easier to do the former while it's fresh in > our minds. Indeed. I have raised

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-16 Thread Alan Bateman
On 14/05/2019 09:00, Andrew Dinn wrote: Hi Mikael, Thanks for looking at this. On 13/05/2019 17:41, Mikael Vidstedt wrote: Would it be worth putting the logic in an aptly named (private) method? Something like: ... private long alignDown(long address, long alignment) {     return

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-14 Thread Andrew Dinn
On 14/05/2019 10:57, Andrew Haley wrote: > On 5/13/19 5:14 PM, Andrew Dinn wrote: >> Thank you for looking at the patch. >> . . . >>firstly, that ps-1 clears the original bit and sets all lower bits; > > I think your core argument fails at this point. You have *already* > moved to considering

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-14 Thread Andrew Haley
On 5/13/19 5:14 PM, Andrew Dinn wrote: > Thank you for looking at the patch. > > On 28/04/2019 18:09, Andrew Haley wrote: >> On 4/25/19 5:34 PM, Andrew Dinn wrote: >>>long map_base = (address & ~(ps - 1)); >> >> This looks like a hard way to write >> >>long map_base = address & -ps; > >

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-14 Thread Andrew Dinn
Hi Mikael, Thanks for looking at this. On 13/05/2019 17:41, Mikael Vidstedt wrote: Would it be worth putting the logic in an aptly named (private) method? Something like: ... private long alignDown(long address, long alignment) { return address & ; } ... long mapBase =

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-14 Thread Andrew Dinn
On 26/04/2019 15:46, Alan Bateman wrote: On 25/04/2019 17:34, Andrew Dinn wrote: Also, here is a new webrev including the updated implementations for mappingAddress/Offset/Length as described below JIRA:   https://bugs.openjdk.java.net/browse/JDK-8221696 webrev:

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-13 Thread Mikael Vidstedt
Would it be worth putting the logic in an aptly named (private) method? Something like: ... private long alignDown(long address, long alignment) { return address & ; } ... long mapBase = alignDown(address, ps); … Cheers, Mikael > On May 13, 2019, at 9:14 AM, Andrew Dinn wrote: > >

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-05-13 Thread Andrew Dinn
Thank you for looking at the patch. On 28/04/2019 18:09, Andrew Haley wrote: On 4/25/19 5:34 PM, Andrew Dinn wrote: long map_base = (address & ~(ps - 1)); This looks like a hard way to write long map_base = address & -ps; My version certainly uses more characters, that is for sure.

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-28 Thread Andrew Haley
On 4/25/19 5:34 PM, Andrew Dinn wrote: > long map_base = (address & ~(ps - 1)); This looks like a hard way to write long map_base = address & -ps; -- Andrew Haley Java Platform Lead Engineer Red Hat UK Ltd. EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-26 Thread Alan Bateman
On 25/04/2019 17:34, Andrew Dinn wrote: Also, here is a new webrev including the updated implementations for mappingAddress/Offset/Length as described below JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.02 This looks right and

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-25 Thread Andrew Dinn
Also, here is a new webrev including the updated implementations for mappingAddress/Offset/Length as described below JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.02 regards, Andrew Dinn --- On 23/04/2019 17:15, Andrew

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-23 Thread Andrew Dinn
Hi Alan, Thanks for looking at this. On 22/04/2019 16:52, Alan Bateman wrote: > The calculation to compute the page aligned address and then the > distance from there to the end of the region is tricky to get right. I > think you have it right, I'm just wondering if we could leverage the >

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-22 Thread Alan Bateman
On 18/04/2019 10:17, Andrew Dinn wrote: Hi Alan, The CSR for this issue has been finalized and is awaiting approval. Would it now be possible to proceed with reviews of the implementation? JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev:

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-18 Thread Andrew Dinn
Hi Alan, The CSR for this issue has been finalized and is awaiting approval. Would it now be possible to proceed with reviews of the implementation? JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.01 regards, Andrew Dinn

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-11 Thread Andrew Dinn
On 11/04/2019 11:34, Alan Bateman wrote: > On 10/04/2019 12:15, Andrew Dinn wrote: >> : >> An updated webrev is available: >> >> JIRA:   https://bugs.openjdk.java.net/browse/JDK-8221696 >> webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.01 >> >> > The updated javadoc looks good. A minor

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-11 Thread Alan Bateman
On 10/04/2019 12:15, Andrew Dinn wrote: : An updated webrev is available: JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.01 The updated javadoc looks good. A minor nit is that it reads "and includes {@code length} bytes" when

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-10 Thread Andrew Dinn
On 09/04/2019 18:59, Alan Bateman wrote: > There are a couple of implementation details to discuss but I'll stick > to the API/javadoc for now so that you can create the CSR. Ok, thanks. > We discussed the method signature, parameter types, and the semantics in > previous mails so I think they

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-10 Thread Andrew Dinn
On 09/04/2019 19:15, Brian Burkhalter wrote: > >> On Apr 9, 2019, at 10:59 AM, Alan Bateman > > wrote: >> >> There are a couple of implementation details to discuss > > I was wondering whether this topic has any synergy / overlap with this > prior thread [1] the

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-10 Thread Andrew Dinn
On 09/04/2019 19:30, Andrew Haley wrote: > On 4/9/19 11:42 AM, Andrew Dinn wrote: >> This new API method was conceived as a preliminary change for JEP 352 to >> allow selective writeback of NVRAM-backed buffers. However, it has been >> implemented to provide a similar capability for file-mapped

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Andrew Haley
On 4/9/19 11:42 AM, Andrew Dinn wrote: > This new API method was conceived as a preliminary change for JEP 352 to > allow selective writeback of NVRAM-backed buffers. However, it has been > implemented to provide a similar capability for file-mapped byte > buffers. The old brute-force API method,

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Brian Burkhalter
> On Apr 9, 2019, at 10:59 AM, Alan Bateman wrote: > > There are a couple of implementation details to discuss I was wondering whether this topic has any synergy / overlap with this prior thread [1] the principal sticking point of which was IIRC forcing / loading a slice of a MBB. Brian

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Alan Bateman
On 09/04/2019 11:42, Andrew Dinn wrote: Could I please get reviews for the following patch which overloads MappedByteBuffer.force to accept a start offset and length. JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.00 This new

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Andrew Dinn
On 09/04/2019 16:04, Daniel Fuchs wrote: > . . . > That reads fine, thanks! Good. Thanks for reviewing this. > BTW: I haven't really looked at the implementation, I'm leaving that to > the experts of the field :-) No problem. I await their expert judgement. regards, Andrew Dinn ---

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Daniel Fuchs
Hi Andrew, On 09/04/2019 13:37, Andrew Dinn wrote: I am not sure that this needs to be mentioned in an implNote. It is of the nature of most memory-mapped storage devices that writeback has a minimum granularity well above byte level. Would you be ok with a correspondingly general caveat? For

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Andrew Dinn
Hi Daniel, Thanks for looking at this. On 09/04/2019 12:28, Daniel Fuchs wrote: > Hi Andrew, > > On 09/04/2019 11:42, Andrew Dinn wrote: >> One detail that is worth highlighting is that for file-backed buffers >> the start address passed to the native method force0 is rounded down to >> a page

Re: RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Daniel Fuchs
Hi Andrew, On 09/04/2019 11:42, Andrew Dinn wrote: One detail that is worth highlighting is that for file-backed buffers the start address passed to the native method force0 is rounded down to a page boundary. This is needed for Unix implementations to ensure that the underlying msync system

RFR : 8221696: MappedByteBuffer.force method to specify range

2019-04-09 Thread Andrew Dinn
Could I please get reviews for the following patch which overloads MappedByteBuffer.force to accept a start offset and length. JIRA: https://bugs.openjdk.java.net/browse/JDK-8221696 webrev: http://cr.openjdk.java.net/~adinn/8221696/webrev.00 This new API method was conceived as a preliminary