RFR: 8304824: NMT should not use ThreadCritical [v9]
Robert Toyonaga
duke at openjdk.org
Mon Nov 4 14:54:37 UTC 2024
On Mon, 4 Nov 2024 07:53:48 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> src/hotspot/share/runtime/mutexLocker.hpp line 31:
>>
>>> 29: #include "runtime/flags/flagSetting.hpp"
>>> 30: #include "runtime/mutex.hpp"
>>> 31: #include "runtime/thread.hpp"
>>
>> This include is not needed because there are no uses that require the definition of Thread.
>>
>> After pull, I am getting circularity errors from runtime/thread.hpp -> jfr/support/jfrThreadLocal.hpp (which now needs runtime/mutexLocker.hpp (-> runtime/thread.hpp)
>>
>> The include of "runtime/thread.hpp" can instead be placed in "nmt/nmtCommon.hpp" which has a use in the NmtVirtualMemoryLocker constructor.
>
>>This include is not needed because there are no uses that require the definition of Thread.
>
> Right, seems like the forward declaration used to be provided by `memory/allocation.hpp`. Let's get rid of the include and use a forward declaration of our own instead.
Should I open another PR to remove it? I can also remove the locking related to NMT in arena.cpp in the same PR as well (as per [this comment](https://github.com/openjdk/jdk/pull/20852#issuecomment-2450515494)).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20852#discussion_r1827863263
More information about the serviceability-dev
mailing list