RFR: Add a limition to allocate object heap in aarch64 with tsan enabled.

Man Cao manc at openjdk.java.net
Tue Apr 21 19:10:46 UTC 2020


On Tue, 21 Apr 2020 05:48:11 GMT, Jie He <github.com+10233373+jhe33 at openjdk.org> wrote:

>> src/hotspot/share/runtime/arguments.cpp line 1859:
>> 
>>> 1858:
>>> 1859:     // With current TSan memory mapping of 48bit aarch64, it's very hard to allocate large continuous space.
>>> 1860:     // Add a limitation to avoid the allocation failure in machine with huge physical RAM.
>> 
>> I'm not familiar with this. Is the 48bit aarch64 issue due to implementation detail of LLVM TSAN runtime? Could you add
>> a link to either documentation or source code for this issue?
>
> struct Mapping48 {
>   static const uptr kLoAppMemBeg   = 0x0000000001000ull;
>   static const uptr kLoAppMemEnd   = 0x0000200000000ull;
>   static const uptr kShadowBeg     = 0x0002000000000ull;
>   static const uptr kShadowEnd     = 0x0004000000000ull;
>   static const uptr kMetaShadowBeg = 0x0005000000000ull;
>   static const uptr kMetaShadowEnd = 0x0006000000000ull;
>   static const uptr kMidAppMemBeg  = 0x0aaaa00000000ull;
>   static const uptr kMidAppMemEnd  = 0x0aaaf00000000ull;
>   static const uptr kTraceMemBeg   = 0x0f06000000000ull;
>   static const uptr kTraceMemEnd   = 0x0f06200000000ull;
>   static const uptr kHeapMemBeg    = 0x0ffff00000000ull;
>   static const uptr kHeapMemEnd    = 0x0ffff00000000ull;
>   static const uptr kHiAppMemBeg   = 0x0ffff00000000ull;
>   static const uptr kHiAppMemEnd   = 0x1000000000000ull;
>   static const uptr kAppMemMsk     = 0x0fff800000000ull;
>   static const uptr kAppMemXor     = 0x0000800000000ull;
>   static const uptr kVdsoBeg       = 0xffff000000000ull;
> };
> 
> yes, LLVM tsan defines 48bit aarch64 memory mapping as above. under this setting, openjdk is very hard to get a large
> continuous vm space (roughly <20G), object heap allocation often fail in a machine which has huge physical RAM.
> big object heap will be allocated in this range:
>  static const uptr kMidAppMemBeg  = 0x0aaaa00000000ull;
>   static const uptr kMidAppMemEnd  = 0x0aaaf00000000ull;

Thanks for the explanation!

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

PR: https://git.openjdk.java.net/tsan/pull/6


More information about the tsan-dev mailing list