RFR: JDK-8298908: Instrument Metaspace for ASan [v12]

Justin King jcking at openjdk.org
Thu Jan 19 17:20:59 UTC 2023


On Mon, 16 Jan 2023 10:08:35 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> If there's no particular reason to do it outside of the lock, I would prefer to have the ASAN call while holding the lock. That way you don't need to worry about race conditions.
>> 
>> 
>> MutexLocker fcl(Metaspace_lock, Mutex::_no_safepoint_check_flag);
>> old_level = c->level();
>> enlarged = c->vsnode()->attempt_enlarge_chunk(c, &_chunks);
>> ASAN_UNPOISON_MEMORY_REGION(....);
>
> Sure, why not. The reason would be reducing time inside the lock, but I'm unemotional. Probably does not matter much.

Poisoning isn't free, it requires memset over a chunk of memory in the shadow region. This will almost guarantee a cache miss. The idea was doing it outside the lock to help speed things up, as with ASan build some tests timeout.

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

PR: https://git.openjdk.org/jdk/pull/11702


More information about the hotspot-runtime-dev mailing list