RFR: 8281263: virtual space leakage if large page commit fails.

Stefan Karlsson stefank at openjdk.java.net
Fri Feb 4 15:36:11 UTC 2022


On Fri, 4 Feb 2022 13:27:58 GMT, Swati Sharma <duke at openjdk.java.net> wrote:

> Hi Team,
> 
> In this patch I have fixed the virtual space leakage issue. While attempting commit over larger pages we first try to reserve requested bytes over the virtual address space, in case commit to large page fails we should be un reserving entire reservation to avoid leaving any leaks in virtual address space.
> 
> Please review and provide your valuable comments.
> 
> 
> Thanks,
> Swati Sharma
> Runtime Software Development Engineer 
> Intel

I'm not convinced that this is needed or even safe. My understanding is that you have already lost the reservation [aligned_start, aligned_start + large_bytes) when the large page commit failed. If that is the case, then it is unsafe to unmap it again, since another thread could race and reserve that memory, and then this thread would potentially unmap the other thread's memory.

Could you provide some data help me understand the problem you are seeing?

I'd like to see the values of aligned_start, large_bytes and bytes and a preferably a dump of /proc/<pid>/maps when  the coded enters the if statement:

if (!large_committed) {
    // Failed to commit large pages, so we need to unmap the

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

Changes requested by stefank (Reviewer).

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


More information about the hotspot-runtime-dev mailing list