[Tarantool-patches] [PATCH luajit 2/2] Linux/ARM64: Make mremap() non-moving due to VA space woes.

Sergey Kaplun skaplun at tarantool.org
Mon Aug 2 18:11:25 MSK 2021


Igor,

On 01.08.21, Igor Munkin wrote:
> Sergey,
> 
> Thanks for the fixes! LGTM, except the single typo.
> 
> On 28.07.21, Sergey Kaplun wrote:
> 
> <snipped>
> 
> > 
> > The new commit message is the following:
> > 
> > ===================================================================
> > Linux/ARM64: Make mremap() non-moving due to VA space woes.
> > 
> > This reduces overall performance on ARM64, but we have no choice.
> > Linux kernel default userspace VA is 48 bit, but we'd need 47 bit.
> > mremap() ignores address hints due to a kernel API issue. The mapping
> > may move to an undesired address which will cause an assert or crash.
> > 
> > Reported by Raymond W. Ko.
> > 
> > (cherry picked from commit 67dbec82f4f05a416a78a560a726553beaa7a223)
> > 
> > 47-bit VA space is required by LuaJIT for keeping a GC object pointer in
> > TValue. In case of huge blobs that are mapped directly, `mremap()` may
> > move the chunk out of 47-bit range of VA space on ARM64. `mremap()`
> > accepts the fifth argument (new address hint) only with MREMAP_FIXED
> > flag. In that case it unmaps any other mapping to specified address.
> > 
> > To avoid this behaviour this patch restricts `mremap()` to relocate
> > the mapping to a new virtual address by set CALL_MREMAP_NOMOVE flag
> 
> Typo: s/set/setting/.

Fixed.

> 
> > instead of CALL_MREMAP_MAYMOVE for arm64 architecture.
> > 
> > Sergey Kaplun:
> > * added the description and the test for the problem
> > 
> > Needed for tarantool/tarantool#6154
> 
> Minor: Why #5629 is not mentioned?

Added.

Branch is force-pushed.

> 
> > ===================================================================
> > 
> 
> <snipped>
> 
> > 
> > -- 
> > Best regards,
> > Sergey Kaplun
> 
> -- 
> Best regards,
> IM

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list