RE: Patch for adding SO_REUSEPORT socket option

2016-01-27 Thread Lu, Yingqi
Hi Alan,

Here is a new version of the patch: 
http://cr.openjdk.java.net/~mcberg/jdk/6432031/webrev.08/

In this version, based on your comment, we have changed following items:

1. Remove the dependency of DatagramSocketImpl and MulticastSocket with 
AbstractPlainSocketImpl. 

2. Made addReusePortOption() to be both thread safe and package private.

Please let us know your feedback and comments.

Thanks,
Lucy


-Original Message-
From: Alan Bateman [mailto:alan.bate...@oracle.com] 
Sent: Friday, January 15, 2016 4:29 AM
To: Lu, Yingqi 
Cc: net-dev@openjdk.java.net; Viswanathan, Sandhya 
; Kharbas, Kishor ; 
Aundhe, Shirish ; Kaczmarek, Eric 

Subject: Re: Patch for adding SO_REUSEPORT socket option

On 14/01/2016 18:28, Lu, Yingqi wrote:
> Hi Alan/Michael/Volker,
>
> Here is the link to the version 7 of the patch. 
> http://cr.openjdk.java.net/~mcberg/jdk/6432031/webrev.07/
>
> Please note: after the code has been uploaded, I found out I forgot to remove 
> extra check of ENOPROTOOPT in the net_util_md.c. Since it took us couple days 
> to upload the code each time, I think it might be a good idea to mark this as 
> an open item for now. I will change it in next version for sure together with 
> anything you found in the current version.
>
>
I think this looks quite good but there is still one architectural issue that 
doesn't look quite right to me.

The issue is that DatagramSocketImpl and MulticastSocket shouldn't be dependent 
on the built-in AbstractPlainSocketImpl. If you develop your own 
DatagramSocketImpl implementation then you'll quickly see the issue. 
It looks like you have it right in SocketImpl, it's just DatagramSocketImpl and 
MulticastSocket where the dependency seems to exist.

One other comment is that I don't think SocketImpl.addAdditionalOptions is 
ready to be exposed in the API (you've added it as a protected method as it 
will become part of the Java SE API). Clearly there is a need for impls to have 
a way to expand the set of socket options but it needs further consideration on 
what that API should be. The simplest is to just drop protected and make this a 
package-private method.

One other point on addAdditionalOptions is that it mutates the set of socket 
options and so is not thread safe. We'll need to come up with a way to do this 
in a safe way.

One final comment is on the Unix version of PlainSocketImpl and 
PlainDatagramSocketImpl. I'm wondering if these changes are really needed. This 
may be something Michael may have suggestions on.

-Alan


JDK-8148424 Support ipv6-only environments

2016-01-27 Thread Martin Buchholz
Are y'all interested in our ipv6-only changes?
https://bugs.openjdk.java.net/browse/JDK-8148424
If yes, there will be some work on both sides, mostly for
multi-platform testing.


Re: RFR: 8147462: URI.toURL could be more efficient for most non-opaque URIs

2016-01-27 Thread Claes Redestad


On 2016-01-18 17:20, Claes Redestad wrote:


The ability for URLStreamHandler implementations to override the 
parseURL method seem to prevent this improvement unless we only do 
this for a subset of known, well-behaved URLStreamHandlers, which 
likely defeat the optimization by adding complexity. 


Right, the fast path can only be safely used for the non-overrideable 
handlers (jrt and file), but turns out we can make that work without 
penalizing other cases:


http://cr.openjdk.java.net/~redestad/8147462/webrev.04/

Relevant micros[1] show that this brings a benefit to file/jrt, even 
when mixed with slow path URIs, while micros only hitting slow path 
(newHttpURIToURL, opaqueURIToURL) doesn't regress:


Before:
Benchmark Mode  CntScoreError Units
URIBench.mixedURIToURLavgt   30  463.748 ± 14.445 ns/op
URIBench.newHttpURIToURL  avgt   30  441.497 ± 20.173 ns/op
URIBench.newURIToURL  avgt   30  227.106 ±  9.055 ns/op
URIBench.opaqueURIToURL   avgt   30  320.904 ± 13.232 ns/op

Patched:
Benchmark Mode  CntScoreError Units
URIBench.mixedURIToURLavgt   30  441.773 ± 16.530 ns/op
URIBench.newHttpURIToURL  avgt   30  433.946 ± 18.569 ns/op
URIBench.newURIToURL  avgt   30  147.379 ±  6.349 ns/op
URIBench.opaqueURIToURL   avgt   30  316.632 ± 12.940 ns/op

/Claes

[1] http://cr.openjdk.java.net/~redestad/8147462/URIBench.java