Linux, hugetlbfs, UseSHM removal?

Thomas Stüfe thomas.stuefe at gmail.com
Fri Jun 23 12:11:04 UTC 2023


Hi all,

We talked about this [1] and StefanJ opened an issue open for it [2], and
also I had private talks with various people. I am currently digging around
in LP initialization again, and getting rid of SHM mode would be so nice.
Perfect time for it too, just after LTS fork-off.

SHM tlbfs mode causes a lot of extra complexity. Since SHM segments can
only be detached as a whole, they behave more like Windows VirtualSpace
instead of mmap. As in, the whole mapping cannot be split, cannot be
partially uncommitted etc. As StefanJ pointed out in [2], it also requires
more permissions than mmap-tlbfs mode.

I have always had the suspicion that this is a dusty corner of hotspot that
is rarely used and probably broken in many corner cases. For example, the
sanity checks at VM startup are not correctly implemented, see JDK-8310262

Therefore, unless someone knows a good reason against removal, I would like
to remove SHM mode from hotspot.

We could get rid of both -XX:+UseSHM and -XX:+UseHugeTLBFS, since one is
the negation of the other. Large page support on Linux would become a lot
simpler then and just a matter of: +UseLargePages and +-UseTHP. A nice
complexity reduction, and we could get rid of a many tests too.

(Obviously, this would need a CSR and Release notes etc).

Any objections?

Thanks, Thomas

[1] https://mail.openjdk.org/pipermail/hotspot-dev/2020-December/046885.html
[2] https://bugs.openjdk.org/browse/JDK-8261894
[3] https://bugs.openjdk.org/browse/JDK-8310262
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20230623/510f2709/attachment-0001.htm>


More information about the hotspot-dev mailing list