RFR: 8261401: Add sanity check for UseSHM large pages similar to the one used with hugetlb large pages [v5]

Thomas Schatzl tschatzl at openjdk.java.net
Wed Feb 17 11:17:42 UTC 2021


On Wed, 17 Feb 2021 10:32:09 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 3570:
>> 
>>> 3568:   // Try to create a large shared memory segment.
>>> 3569:   int shmid = shmget(IPC_PRIVATE, page_size, SHM_HUGETLB|IPC_CREAT|SHM_R|SHM_W);
>>> 3570:   if (shmid == -1) {
>> 
>> I think the flags should contain the `SHM_HUGE_*` flags (considering large pages) similar to hugetlbfs for proper checking to avoid the failure like in [JDK-8261636](https://bugs.openjdk.java.net/browse/JDK-8261636) reported just recently for the same reason.
>> 
>> According to the [man pages](https://man7.org/linux/man-pages/man2/shmget.2.html)] such flags exist.
>
> I would agree if the later usage of `shmget()` would make use of those flags but it don't. We might want o add a CR for enabling use of other page sizes than the default large page size for SHM as well. But there is also discussions about trying to remove this SHM support.

I am good with creating a CR for that. We can always close it later.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2488


More information about the hotspot-dev mailing list