RFR: 8305819: LogConfigurationTest intermittently fails on AArch64
gaogao-mem
duke at openjdk.org
Tue Apr 25 10:58:23 UTC 2023
On Fri, 21 Apr 2023 08:24:08 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> Thanks for your suggestion! The performance issue I mentioned earlier was due to adding OrderAccess::loadload while reading the list, but after researching some information for memory barrier, it was found to be unnecessary.
>
> Atomic access is unnecessary when reading the list? I'd like to know the reasoning behind that.
> I guess you could argue that dependency would save you on the read side, but I'd like to see and understand the code. It's very risky to depend on that,
The list is read in src/hotspot/share/logging/logTagSet.cpp by iterator in src/hotspot/share/logging/logOutputList.hpp.
For example, in void LogTagSet::log(LogLevelType level, const char* msg), the list is read as follows:
```
src/hotspot/share/logging/logTagSet.cpp
LogOutputList::Iterator it = _output_list.iterator(level);
LogDecorations decorations(level, *this, _decorators);
for (; it != _output_list.end(); it++) {
(*it)->write(decorations, msg);
}
And I intended to add loadload in Iterator as follows:
```
src/hotspot/share/logging/logOutputList.hpp
void operator++(int) {
_current = _current->_next;
+ OrderAccess::loadload();
}
Iterator iterator(LogLevelType level = LogLevel::Last) {
increase_readers();
- return Iterator(this, _level_start[level]);
+ LogOutputNode* start=_level_start[level];
+ OrderAccess::loadload();
+ return Iterator(this, start);
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13421#discussion_r1173569182
More information about the hotspot-runtime-dev
mailing list