RFR: 8254877: GCLogPrecious::_lock rank constrains what locks you are allowed to have when crashing

Kim Barrett kbarrett at openjdk.java.net
Wed Oct 28 13:17:44 UTC 2020


On Wed, 28 Oct 2020 11:38:10 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> Today, when you crash, the GCLogPrecious::_lock is taken. This effectively limits you to only get clean crash reports if you crash or assert without holding a lock of rank tty or lower. It is arguably difficult to know what locks you are going to have when crashing. Therefore, I don't think the precious GC log should constrain possible crashing contexts in that fashion.
> 
> This patch inserts the precious GC lines into a linked list instead, that can be traversed concurrently, without holding any locks. This allows you to crash in contexts where "low" ranked locks are held.
> 
> I have manually verified that the hs_err precious GC log looks identical before and after my change.

Changes requested by kbarrett (Reviewer).

src/hotspot/share/gc/shared/gcLogPrecious.cpp line 58:

> 56:   GCLogPreciousLine* tail = _tail;
> 57: 
> 58:   if (head == NULL) {

I think this should be `Atomic::load(&_head)`. This would make the `head` local variable unused.

src/hotspot/share/gc/shared/gcLogPrecious.cpp line 63:

> 61:   if (_tail != NULL) {
> 62:     tail->set_next(line);
> 63:   }

Either 61 should be using `tail` or 62 should be using `_tail`.  If the latter then the `tail` local variable is unused.

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

PR: https://git.openjdk.java.net/jdk/pull/900



More information about the hotspot-gc-dev mailing list