Linux, hugetlbfs, UseSHM removal?
Stefan Karlsson
stefan.karlsson at oracle.com
Mon Jun 26 07:19:02 UTC 2023
I'm asking around to see if I can get an answer how important UseSHM is.
StefanK
On 2023-06-23 14:11, Thomas Stüfe wrote:
> 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
More information about the hotspot-dev
mailing list