RFR: 8245002: Windows GDI functions don't support NUMA interleaving
Stefan Karlsson
stefan.karlsson at oracle.com
Fri May 15 17:46:43 UTC 2020
Hi all,
Please review this patch to turn off -XX:+UseNUMAInterleaving as long as
Windows GDI functions don't work with memory that crosses memory
reservation boundaries.
https://cr.openjdk.java.net/~stefank/8245002/webrev.00.cleanup
https://cr.openjdk.java.net/~stefank/8245002/webrev.01.workaround
https://cr.openjdk.java.net/~stefank/8245002/webrev.all
https://bugs.openjdk.java.net/browse/JDK-8245002
During the investigation of JDK-8240654 it was found that some of the
Windows GDI functions don't work with our NUMA interleaving
implementation (-XX:+UseNUMAInterleaving). This causes severe repaint
issues.
The underlying issue is that these functions don't accept memory
spanning over multiple memory reservations.
The problem can easily be seen with the Java2D demos, where the drawn UI
is grayed out instead of containing all relevant components.
This can be reproduced by running building J2DBench and running:
java -Xmx1g -Xms1g -XX:+UseNUMAInterleaving -Dsun.java2d.opengl=False
-Dsun.java2d.d3d=False -jar dist/J2DBench.jar
The -Dsun.java2d.d3d property is used to ensure that that java2d doesn't
enable the alternative, D3D implementation instead of GDI.
-Dsun.java2d.opengl is turned off for the same reason.
The cleanup patch makes it slightly easier to insert the necessary
check. It's not crucial for this fix, but it mimics the change I'm doing
in large_page_init for JDK-8245002.
The workaround patch reserves two adjacent memory areas, commit the
memory, and then uses the address of last byte of the first memory
region as input to one of the GDI functions. If the function returns a
failure, we know that it doesn't work with memory spanning multiple
reservations, and we turn off -XX:+UseNUMAInterleaving. I've chosen
CreateBitmap as the GDI function to test, mainly because it has a very
simple interface, without any extra dependencies.
The intention is that as long as these function can't use
multi-reservation memory, the flag will be turned off. If Microsoft
changes the GDI code, so that it works with this kind of memory, then
the proposed patch will automatically allow the flag to be enabled.
I've run this through tier1-3 and also tested this manually. I
temporarily turned of the checks to verify that it turns on the flag.
Thanks,
StefanK
More information about the hotspot-dev
mailing list