Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v7]

2022-12-08 Thread Carter Kozak
On Thu, 8 Dec 2022 18:24:03 GMT, Andrew Haley wrote: >> Anthony Scarpino has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - editor screwed up >> - why won't this merge hell stop 2 >> - why won't this merge hell stop 3 > > What benchma

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v7]

2022-12-08 Thread Andrew Haley
On Tue, 6 Dec 2022 20:29:56 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >>

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v7]

2022-12-06 Thread Anthony Scarpino
> I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > method during decryption. A temporary buffer was used because

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v6]

2022-12-06 Thread Anthony Scarpino
> I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > method during decryption. A temporary buffer was used because

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v5]

2022-12-06 Thread Anthony Scarpino
> I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > method during decryption. A temporary buffer was used because

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v4]

2022-12-05 Thread Anthony Scarpino
> I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > method during decryption. A temporary buffer was used because

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v3]

2022-12-01 Thread Valerie Peng
On Thu, 1 Dec 2022 04:19:37 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >>

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-12-01 Thread Valerie Peng
On Thu, 1 Dec 2022 04:10:32 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java >> line 778: >> >>> 776: gctr, ghash); >>> 777: } else { >>> 778: int ofs = src.arrayOff

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v3]

2022-12-01 Thread Jamil Nimeh
On Thu, 1 Dec 2022 04:19:37 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >>

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v3]

2022-11-30 Thread Anthony Scarpino
> I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > method during decryption. A temporary buffer was used because

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-30 Thread Anthony Scarpino
On Thu, 1 Dec 2022 02:10:01 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comment cleanup & finesse ByteBuffer implGCMCrypt better > > src/java.base/share/classes/com/sun/crypto/provider/Gal

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-30 Thread Valerie Peng
On Mon, 21 Nov 2022 18:20:09 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-30 Thread Valerie Peng
On Mon, 21 Nov 2022 18:20:09 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-30 Thread Valerie Peng
On Wed, 16 Nov 2022 16:55:39 GMT, Mark Powers wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comment cleanup & finesse ByteBuffer implGCMCrypt better > > src/java.base/share/classes/com/sun/crypto/provider/Gal

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-21 Thread Anthony Scarpino
On Fri, 18 Nov 2022 05:19:31 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java >> line 694: >> >>> 692: int originalOutOfs = 0; >>> 693: >>> 694: // True if op is in-place array decryption with the input & >>> output >>

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-21 Thread Anthony Scarpino
On Wed, 16 Nov 2022 17:01:50 GMT, Mark Powers wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> comment cleanup & finesse ByteBuffer implGCMCrypt better > > src/java.base/share/classes/com/sun/crypto/provider/Gal

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-21 Thread Anthony Scarpino
On Sun, 13 Nov 2022 02:54:10 GMT, Anthony Scarpino wrote: > I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > m

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-11-21 Thread Anthony Scarpino
> I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > method during decryption. A temporary buffer was used because

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-17 Thread Anthony Scarpino
On Wed, 16 Nov 2022 16:57:14 GMT, Mark Powers wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >> met

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-17 Thread Anthony Scarpino
On Wed, 16 Nov 2022 17:38:19 GMT, Mark Powers wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >> met

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-17 Thread Carter Kozak
On Thu, 17 Nov 2022 18:24:07 GMT, Anthony Scarpino wrote: > Looking at this, it's not related to the same in-place issues. This is a > result of the combined intrinsics requirement . Maybe some better tuning can > be done, but I think this is unavoidable. I can consider this in a future PR Th

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-17 Thread Anthony Scarpino
On Wed, 16 Nov 2022 18:48:58 GMT, Anthony Scarpino wrote: > Thanks for looking into this, @ascarpino! > > In testing this using a local build, it improves performance in cases using > heap buffers (a super-set of the socket case), however servers which use > direct byte-buffers still exhibit

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread Carter Kozak
On Sun, 13 Nov 2022 02:54:10 GMT, Anthony Scarpino wrote: > I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > m

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread Anthony Scarpino
On Wed, 16 Nov 2022 17:00:37 GMT, Mark Powers wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >> met

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread Anthony Scarpino
On Wed, 16 Nov 2022 18:19:30 GMT, Anthony Scarpino wrote: >> It's possibly worth noting that while this is merely fixing a regression for >> x86, it's very likely a decent sized performance improvement on arm64, where >> intrinsics for AES-GCM (depending on JVM vendor) aren't added until after

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread Anthony Scarpino
On Wed, 16 Nov 2022 16:18:15 GMT, James Baker wrote: > It's possibly worth noting that while this is merely fixing a regression for > x86, it's very likely a decent sized performance improvement on arm64, where > intrinsics for AES-GCM (depending on JVM vendor) aren't added until after > Java

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread Mark Powers
On Sun, 13 Nov 2022 02:54:10 GMT, Anthony Scarpino wrote: > I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > m

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread James Baker
On Sun, 13 Nov 2022 02:54:10 GMT, Anthony Scarpino wrote: > I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > m

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread Carter Kozak
On Sun, 13 Nov 2022 02:54:10 GMT, Anthony Scarpino wrote: > I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > m

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-16 Thread James Baker
On Sun, 13 Nov 2022 02:54:10 GMT, Anthony Scarpino wrote: > I would like a review of an update to the GCM code. A recent report showed > that GCM memory usage for TLS was very large. This was a result of in-place > buffers, which TLS uses, and how the code handled the combined intrinsic > m

RFR: 8296507: GCM using more memory than necessary with in-place operations

2022-11-15 Thread Anthony Scarpino
I would like a review of an update to the GCM code. A recent report showed that GCM memory usage for TLS was very large. This was a result of in-place buffers, which TLS uses, and how the code handled the combined intrinsic method during decryption. A temporary buffer was used because the com